From 765f8767ef1b4fa67fb96e259b10c3e9ece5edf7 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Tue, 14 May 2024 09:52:30 +0200 Subject: [PATCH] avvidec: Fix dropping wrong "ghost" frames This fixes the code regarding dropping "ghost frames", that is to say input frames which ended up not producing any decoded frame. The iteration itself makes sense.. but it was stopping at the "input" frame and not the decoded frame we just got back. When dealing with I-frame codecs, ffmpeg will decode frames in separate frames, so there is no guarantee that they are decoding in order. Fixes playback issues with such codecs Part-of: --- subprojects/gst-libav/ext/libav/gstavviddec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-libav/ext/libav/gstavviddec.c b/subprojects/gst-libav/ext/libav/gstavviddec.c index 537eb3d71b..fe1ea51aa6 100644 --- a/subprojects/gst-libav/ext/libav/gstavviddec.c +++ b/subprojects/gst-libav/ext/libav/gstavviddec.c @@ -2037,7 +2037,7 @@ gst_ffmpegviddec_video_frame (GstFFMpegVidDec * ffmpegdec, while (l) { GstVideoCodecFrame *tmp = l->data; - if (tmp == frame) + if (tmp == out_frame) old = FALSE; if (old && GST_VIDEO_CODEC_FRAME_IS_DECODE_ONLY (tmp)) {