From 6704b2ca5a451b20a0b945b3426ef066653bb025 Mon Sep 17 00:00:00 2001 From: jojo61 Date: Fri, 22 Sep 2023 12:00:08 +0200 Subject: [PATCH] Fix channelswitch with YADIF deinterlacer --- softhdcuvid.cpp | 2 +- video.c | 23 ++++++++++++----------- 2 files changed, 13 insertions(+), 12 deletions(-) diff --git a/softhdcuvid.cpp b/softhdcuvid.cpp index 97e8e25..d2ba437 100644 --- a/softhdcuvid.cpp +++ b/softhdcuvid.cpp @@ -61,7 +61,7 @@ extern void ToggleLUT(); /// vdr-plugin version number. /// Makefile extracts the version number for generating the file name /// for the distribution archive. -static const char *const VERSION = "3.13" +static const char *const VERSION = "3.14" #ifdef GIT_REV "-GIT" GIT_REV #endif diff --git a/video.c b/video.c index 552cc7d..b0b4bc9 100644 --- a/video.c +++ b/video.c @@ -2960,6 +2960,18 @@ static enum AVPixelFormat Cuvid_get_format(CuvidDecoder *decoder, AVCodecContext VideoThreadUnlock(); // dont show first frame #endif + } else { + decoder->SyncCounter = 0; + decoder->FrameCounter = 0; + decoder->FramesDisplayed = 0; + decoder->StartCounter = 0; + decoder->Closing = 0; + decoder->PTS = AV_NOPTS_VALUE; + VideoDeltaPTS = 0; + decoder->InputAspect = video_ctx->sample_aspect_ratio; + CuvidUpdateOutput(decoder); // update aspect/scaling + } + #ifdef YADIF if (VideoDeinterlace[decoder->Resolution] == VideoDeinterlaceYadif) { deint = 0; @@ -2973,17 +2985,6 @@ static enum AVPixelFormat Cuvid_get_format(CuvidDecoder *decoder, AVCodecContext Fatal(_("codec: can't set option deint to video codec!\n")); } #endif - } else { - decoder->SyncCounter = 0; - decoder->FrameCounter = 0; - decoder->FramesDisplayed = 0; - decoder->StartCounter = 0; - decoder->Closing = 0; - decoder->PTS = AV_NOPTS_VALUE; - VideoDeltaPTS = 0; - decoder->InputAspect = video_ctx->sample_aspect_ratio; - CuvidUpdateOutput(decoder); // update aspect/scaling - } CuvidMessage(2, "GetFormat Init ok %dx%d\n", video_ctx->width, video_ctx->height); decoder->InputAspect = video_ctx->sample_aspect_ratio;