mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-12-18 14:26:43 +00:00
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
1 changed files with 6 additions and 0 deletions
|
@ -292,13 +292,16 @@ gst_vp8_dec_stop (GstVideoDecoder * base_video_decoder)
|
|||
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;
|
||||
}
|
||||
|
||||
if (gst_vp8_dec->decoder_inited)
|
||||
vpx_codec_destroy (&gst_vp8_dec->decoder);
|
||||
gst_vp8_dec->decoder_inited = FALSE;
|
||||
|
||||
return TRUE;
|
||||
}
|
||||
|
||||
|
@ -308,6 +311,9 @@ gst_vp8_dec_set_format (GstVideoDecoder * decoder, GstVideoCodecState * state)
|
|||
GstVP8Dec *gst_vp8_dec = GST_VP8_DEC (decoder);
|
||||
|
||||
GST_DEBUG_OBJECT (gst_vp8_dec, "set_format");
|
||||
|
||||
if (decoder->decoder_inited)
|
||||
vpx_codec_destroy (&decoder->decoder);
|
||||
gst_vp8_dec->decoder_inited = FALSE;
|
||||
|
||||
if (gst_vp8_dec->input_state)
|
||||
|
|
Loading…
Reference in a new issue