vp8dec: Reset output and input states when changing format

https://bugzilla.gnome.org/show_bug.cgi?id=734266
This commit is contained in:
Jose Antonio Santos Cadenas 2014-08-05 10:34:39 +02:00 committed by Thiago Santos
parent 3a1e010221
commit f22b91dad5

View file

@ -318,8 +318,16 @@ gst_vp8_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
vpx_codec_destroy (&gst_vp8_dec->decoder); vpx_codec_destroy (&gst_vp8_dec->decoder);
gst_vp8_dec->decoder_inited = FALSE; 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_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); gst_vp8_dec->input_state = gst_video_codec_state_ref (state);
return TRUE; return TRUE;