From 87158bd6cdb05dc316e7e9eec01fd2fc93a64836 Mon Sep 17 00:00:00 2001 From: =?UTF-8?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 b96c88243a..dce469346a 100644 --- a/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c +++ b/subprojects/gst-plugins-bad/sys/applemedia/vtdec.c @@ -1020,7 +1020,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