adaptivedemux: fix leak of stream->internal_pad
authorAlex Ashley <alex.ashley@youview.com>
Fri, 22 Jan 2016 16:43:03 +0000 (16:43 +0000)
committerSebastian Dröge <sebastian@centricular.com>
Fri, 22 Jan 2016 17:04:42 +0000 (19:04 +0200)
commitcfb1b7951617b2c8dd35c3ccdd3feec6765321a7
tree49eccc48a9162bbdee0fc76276ed64f46f8e80c2
parent8e788f284508612982e8e38336eed676c2eec35a
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
gst-libs/gst/adaptivedemux/gstadaptivedemux.c