codecs: {vp8,vp9}decoder: Drain on new_sequence()

Decoder should drain queued frame (if any) and empty DPB before
starting new sequence.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/987>
This commit is contained in:
Seungha Yang 2021-09-18 22:51:53 +09:00 committed by GStreamer Marge Bot
parent 834d6f4031
commit 571aad3980
2 changed files with 16 additions and 0 deletions

View file

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

View file

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