From aedd5f0dd1e9bb8945092434fcf77c055e9e6c34 Mon Sep 17 00:00:00 2001 From: Nicolas Dufresne Date: Tue, 2 Nov 2021 09:40:43 -0400 Subject: [PATCH] codecs: mpeg2: Drain before a new_sequence get signalled The decoder may need to re-allocate the output buffer, it is easier if all pictured have been outputed. Part-of: --- .../gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c index 4dfa3c2adc..029d93a4a6 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstmpeg2decoder.c @@ -740,6 +740,10 @@ gst_mpeg2_decoder_handle_picture (GstMpeg2Decoder * decoder, if (priv->seq_changed) { GstFlowReturn ret; + ret = gst_mpeg2_decoder_drain (GST_VIDEO_DECODER (decoder)); + if (ret != GST_FLOW_OK) + return ret; + if (klass->get_preferred_output_delay) priv->preferred_output_delay = klass->get_preferred_output_delay (decoder, priv->is_live);