vp8dec: Also destroy decoder in set_format() if it was created already
Fixes a memory leak.
This commit is contained in:
parent
bd0ef7fec3
commit
ef2cc91eb9
@ -292,13 +292,16 @@ gst_vp8_dec_stop (GstVideoDecoder * base_video_decoder)
|
|||||||
gst_video_codec_state_unref (gst_vp8_dec->output_state);
|
gst_video_codec_state_unref (gst_vp8_dec->output_state);
|
||||||
gst_vp8_dec->output_state = NULL;
|
gst_vp8_dec->output_state = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_vp8_dec->input_state) {
|
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 = NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (gst_vp8_dec->decoder_inited)
|
if (gst_vp8_dec->decoder_inited)
|
||||||
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;
|
||||||
|
|
||||||
return TRUE;
|
return TRUE;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -308,6 +311,9 @@ gst_vp8_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
|
|||||||
GstVP8Dec *gst_vp8_dec = GST_VP8_DEC (decoder);
|
GstVP8Dec *gst_vp8_dec = GST_VP8_DEC (decoder);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (gst_vp8_dec, "set_format");
|
GST_DEBUG_OBJECT (gst_vp8_dec, "set_format");
|
||||||
|
|
||||||
|
if (decoder->decoder_inited)
|
||||||
|
vpx_codec_destroy (&decoder->decoder);
|
||||||
gst_vp8_dec->decoder_inited = FALSE;
|
gst_vp8_dec->decoder_inited = FALSE;
|
||||||
|
|
||||||
if (gst_vp8_dec->input_state)
|
if (gst_vp8_dec->input_state)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user