vtdec: Fix not waiting for async frames when flushing
authorPiotr Brzeziński <piotr@centricular.com>
Thu, 9 Feb 2023 17:51:30 +0000 (18:51 +0100)
committerGStreamer Marge Bot <gitlab-merge-bot@gstreamer-foundation.org>
Fri, 10 Feb 2023 20:29:15 +0000 (20:29 +0000)
This was causing incorrect output when seeking, especially
when used with a multithreaded source like `videotestsrc n-threads=2`.
It should now correctly wait for frames still being processed by VT
while vtdec is flushing.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3937>

subprojects/gst-plugins-bad/sys/applemedia/vtdec.c

index 6a459e8..5cb2ae5 100644 (file)
@@ -1033,7 +1033,7 @@ gst_vtdec_push_frames_if_needed (GstVtdec * vtdec, gboolean drain,
     }
   }
 
-  if (drain)
+  if (drain || flush)
     VTDecompressionSessionWaitForAsynchronousFrames (vtdec->session);
 
   /* push a buffer if there are enough frames to guarantee that we push in PTS