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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/6846>
This commit is contained in:
Edward Hervey 2024-05-14 09:52:30 +02:00 committed by Backport Bot
parent e7dd50f110
commit 43dcbd5bf9

View file

@ -1937,7 +1937,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)) {