From f22b91dad52ae609f76cfda1b9ad6b064722273a Mon Sep 17 00:00:00 2001 From: Jose Antonio Santos Cadenas Date: Tue, 5 Aug 2014 10:34:39 +0200 Subject: [PATCH] vp8dec: Reset output and input states when changing format https://bugzilla.gnome.org/show_bug.cgi?id=734266 --- ext/vpx/gstvp8dec.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/ext/vpx/gstvp8dec.c b/ext/vpx/gstvp8dec.c index 5efcdd3967..6f3d7d7fcd 100644 --- a/ext/vpx/gstvp8dec.c +++ b/ext/vpx/gstvp8dec.c @@ -318,8 +318,16 @@ gst_vp8_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state) vpx_codec_destroy (&gst_vp8_dec->decoder); gst_vp8_dec->decoder_inited = FALSE; - if (gst_vp8_dec->input_state) + if (gst_vp8_dec->output_state) { + gst_video_codec_state_unref (gst_vp8_dec->output_state); + gst_vp8_dec->output_state = NULL; + } + + if (gst_vp8_dec->input_state) { gst_video_codec_state_unref (gst_vp8_dec->input_state); + gst_vp8_dec->input_state = NULL; + } + gst_vp8_dec->input_state = gst_video_codec_state_ref (state); return TRUE;