From 8fd9c823602bb81daf59795b3d0768f558071c08 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Piotr=20Brzezi=C5=84ski?= Date: Thu, 9 Feb 2023 18:51:30 +0100 Subject: [PATCH] vtdec: Fix not waiting for async frames when flushing 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: --- subprojects/gst-plugins-bad/sys/applemedia/vtdec.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c b/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c index 6a459e8..5cb2ae5 100644 --- a/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c +++ b/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c @@ -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 -- 2.7.4