Fix jumps between recording marks

This commit is contained in:
jojo61 2020-06-09 09:23:38 +02:00
parent e4115f348b
commit a28e368c1b
5 changed files with 12 additions and 6 deletions

View File

@ -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);
}
}

View File

@ -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

View File

@ -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;
}

View File

@ -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);
}

View File

@ -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 *);