mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-22 23:28:16 +00:00
adaptivedemux: fix leak of stream->internal_pad
The function gst_adaptive_demux_stream_update_source() function creates a new GstPad called internal_pad. This pad is not freed when releasing the stream. The solution is to set GST_PAD_FLAG_NEED_PARENT so that the chain functions do not get called when the pad has no parent and then remove the parent in the gst_adaptive_demux_stream_free() function. This causes the refcount of the pad to be set to zero. https://bugzilla.gnome.org/show_bug.cgi?id=760982
This commit is contained in:
parent
8e788f2845
commit
cfb1b79516
1 changed files with 5 additions and 0 deletions
|
@ -1132,6 +1132,10 @@ gst_adaptive_demux_stream_free (GstAdaptiveDemuxStream * stream)
|
|||
stream->pending_events = NULL;
|
||||
}
|
||||
|
||||
if (stream->internal_pad) {
|
||||
gst_object_unparent (GST_OBJECT_CAST (stream->internal_pad));
|
||||
}
|
||||
|
||||
if (stream->src_srcpad) {
|
||||
gst_object_unref (stream->src_srcpad);
|
||||
stream->src_srcpad = NULL;
|
||||
|
@ -2293,6 +2297,7 @@ gst_adaptive_demux_stream_update_source (GstAdaptiveDemuxStream * stream,
|
|||
g_free (internal_name);
|
||||
gst_object_set_parent (GST_OBJECT_CAST (stream->internal_pad),
|
||||
GST_OBJECT_CAST (demux));
|
||||
GST_OBJECT_FLAG_SET (stream->internal_pad, GST_PAD_FLAG_NEED_PARENT);
|
||||
gst_pad_set_element_private (stream->internal_pad, stream);
|
||||
gst_pad_set_active (stream->internal_pad, TRUE);
|
||||
gst_pad_set_chain_function (stream->internal_pad, _src_chain);
|
||||
|
|
Loading…
Reference in a new issue