mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-18 07:47:17 +00:00
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:
parent
834d6f4031
commit
571aad3980
2 changed files with 16 additions and 0 deletions
|
@ -168,6 +168,14 @@ gst_vp8_decoder_check_codec_change (GstVp8Decoder * self,
|
||||||
if (changed || !priv->had_sequence) {
|
if (changed || !priv->had_sequence) {
|
||||||
GstVp8DecoderClass *klass = GST_VP8_DECODER_GET_CLASS (self);
|
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;
|
priv->had_sequence = TRUE;
|
||||||
|
|
||||||
if (klass->get_preferred_output_delay)
|
if (klass->get_preferred_output_delay)
|
||||||
|
|
|
@ -193,6 +193,14 @@ gst_vp9_decoder_check_codec_change (GstVp9Decoder * self,
|
||||||
if (changed || !priv->had_sequence) {
|
if (changed || !priv->had_sequence) {
|
||||||
GstVp9DecoderClass *klass = GST_VP9_DECODER_GET_CLASS (self);
|
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;
|
priv->had_sequence = TRUE;
|
||||||
|
|
||||||
if (klass->get_preferred_output_delay) {
|
if (klass->get_preferred_output_delay) {
|
||||||
|
|
Loading…
Reference in a new issue