diff --git a/codec.c b/codec.c index 7212ca5..4ad7824 100644 --- a/codec.c +++ b/codec.c @@ -648,7 +648,7 @@ void CodecVideoDecode(VideoDecoder * decoder, const AVPacket * avpkt) void CodecVideoFlushBuffers(VideoDecoder * decoder) { if (decoder->VideoCtx) { - // avcodec_flush_buffers(decoder->VideoCtx); + avcodec_flush_buffers(decoder->VideoCtx); } } diff --git a/softhdcuvid.cpp b/softhdcuvid.cpp index 5601376..9f3c670 100644 --- a/softhdcuvid.cpp +++ b/softhdcuvid.cpp @@ -61,7 +61,7 @@ extern "C" /// vdr-plugin version number. /// Makefile extracts the version number for generating the file name /// for the distribution archive. -static const char *const VERSION = "3.2.0" +static const char *const VERSION = "3.2.1" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/softhddev.c b/softhddev.c index 7dad487..41d63c7 100644 --- a/softhddev.c +++ b/softhddev.c @@ -1832,7 +1832,7 @@ int VideoPollInput(VideoStream * stream) ** @retval 1 stream paused ** @retval -1 empty stream */ -int VideoDecodeInput(VideoStream * stream) +int VideoDecodeInput(VideoStream * stream, int trick) { int filled; AVPacket *avpkt; @@ -1850,6 +1850,9 @@ int VideoDecodeInput(VideoStream * stream) stream->Close = 0; return 1; } + if (stream->ClearBuffers && trick) + stream->ClearBuffers = 0; + if (stream->ClearBuffers) { // clear buffer request atomic_set(&stream->PacketsFilled, 0); stream->PacketRead = stream->PacketWrite; @@ -2676,12 +2679,14 @@ void StillPicture(const uint8_t * data, int size) #ifdef STILL_DEBUG fprintf(stderr, "still-picture\n"); #endif + for (i = 0; i < (MyVideoStream->CodecID == AV_CODEC_ID_HEVC ? 12 : 12); ++i) { const uint8_t *split; int n; // FIXME: vdr pes recordings sends mixed audio/video if ((data[3] & 0xF0) == 0xE0) { // PES packet + split = data; n = size; // split the I-frame into single pes packets @@ -2715,7 +2720,7 @@ void StillPicture(const uint8_t * data, int size) VideoNextPacket(MyVideoStream, MyVideoStream->CodecID); // terminate last packet } else { // ES packet - if (MyVideoStream->CodecID != AV_CODEC_ID_MPEG2VIDEO) { + if (0 && MyVideoStream->CodecID != AV_CODEC_ID_MPEG2VIDEO) { VideoNextPacket(MyVideoStream, AV_CODEC_ID_NONE); // close last stream MyVideoStream->CodecID = AV_CODEC_ID_MPEG2VIDEO; } diff --git a/video.c b/video.c index 87e71f6..8301459 100644 --- a/video.c +++ b/video.c @@ -4168,6 +4168,7 @@ static void CuvidDisplayFrame(void) pthread_mutex_unlock(&OSDMutex); } + if (OsdShown == 2) { CuvidMixVideo(decoder, i, &target, &osdoverlay); } else { @@ -4697,7 +4698,7 @@ static void CuvidDisplayHandlerThread(void) // FIXME: hot polling // fetch+decode or reopen allfull = 0; - err = VideoDecodeInput(decoder->Stream); + err = VideoDecodeInput(decoder->Stream,decoder->TrickSpeed); } else { err = VideoPollInput(decoder->Stream); } diff --git a/video.h b/video.h index e4d9ea3..0414fec 100644 --- a/video.h +++ b/video.h @@ -231,7 +231,7 @@ extern void VideoExit(void); ///< Cleanup and exit video module. extern int VideoPollInput(VideoStream *); /// Decode video input buffers. -extern int VideoDecodeInput(VideoStream *); +extern int VideoDecodeInput(VideoStream *, int); /// Get number of input buffers. extern int VideoGetBuffers(const VideoStream *);