diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c index d99bd5e855..9f6c8978b3 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp8decoder.c @@ -168,6 +168,14 @@ gst_vp8_decoder_check_codec_change (GstVp8Decoder * self, if (changed || !priv->had_sequence) { GstVp8DecoderClass *klass = GST_VP8_DECODER_GET_CLASS (self); + /* Drain before new sequence */ + ret = gst_vp8_decoder_drain_internal (self, FALSE); + if (ret != GST_FLOW_OK) { + GST_WARNING_OBJECT (self, "Failed to drain pending frames, returned %s", + gst_flow_get_name (ret)); + return ret; + } + priv->had_sequence = TRUE; if (klass->get_preferred_output_delay) diff --git a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c index d8db0c1602..5fca5fabb7 100644 --- a/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c +++ b/subprojects/gst-plugins-bad/gst-libs/gst/codecs/gstvp9decoder.c @@ -193,6 +193,14 @@ gst_vp9_decoder_check_codec_change (GstVp9Decoder * self, if (changed || !priv->had_sequence) { GstVp9DecoderClass *klass = GST_VP9_DECODER_GET_CLASS (self); + /* Drain before new sequence */ + ret = gst_vp9_decoder_drain_internal (self, FALSE); + if (ret != GST_FLOW_OK) { + GST_WARNING_OBJECT (self, "Failed to drain pending frames, returned %s", + gst_flow_get_name (ret)); + return ret; + } + priv->had_sequence = TRUE; if (klass->get_preferred_output_delay) {