mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-06-05 06:58:56 +00:00
basevideodecoder: Fix reference counting of codec_data
This commit is contained in:
parent
cacdd29b5c
commit
27b677d179
1 changed files with 3 additions and 2 deletions
|
@ -300,6 +300,7 @@ gst_base_video_decoder_setcaps (GstBaseVideoDecoder * base_video_decoder,
|
||||||
codec_data = gst_structure_get_value (structure, "codec_data");
|
codec_data = gst_structure_get_value (structure, "codec_data");
|
||||||
if (codec_data && G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
|
if (codec_data && G_VALUE_TYPE (codec_data) == GST_TYPE_BUFFER) {
|
||||||
state.codec_data = GST_BUFFER (gst_value_get_buffer (codec_data));
|
state.codec_data = GST_BUFFER (gst_value_get_buffer (codec_data));
|
||||||
|
gst_buffer_ref (state.codec_data);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (base_video_decoder_class->set_format) {
|
if (base_video_decoder_class->set_format) {
|
||||||
|
@ -308,8 +309,8 @@ gst_base_video_decoder_setcaps (GstBaseVideoDecoder * base_video_decoder,
|
||||||
}
|
}
|
||||||
|
|
||||||
if (ret) {
|
if (ret) {
|
||||||
gst_buffer_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->
|
gst_buffer_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state.
|
||||||
state.codec_data, NULL);
|
codec_data, NULL);
|
||||||
gst_caps_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state.caps,
|
gst_caps_replace (&GST_BASE_VIDEO_CODEC (base_video_decoder)->state.caps,
|
||||||
NULL);
|
NULL);
|
||||||
GST_BASE_VIDEO_CODEC (base_video_decoder)->state = state;
|
GST_BASE_VIDEO_CODEC (base_video_decoder)->state = state;
|
||||||
|
|
Loading…
Reference in a new issue