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: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1013>
This commit is contained in:
Nicolas Dufresne 2021-11-02 09:40:43 -04:00 committed by GStreamer Marge Bot
parent f9958eda8e
commit aedd5f0dd1

View file

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