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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/3939>
This commit is contained in:
Piotr Brzeziński 2023-02-09 18:51:30 +01:00 committed by Tim-Philipp Müller
parent 46719759bc
commit 87158bd6cd

View file

@ -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