diff options
author | Sebastian Dröge <sebastian@centricular.com> | 2015-12-25 11:34:10 +0100 |
---|---|---|
committer | Sebastian Dröge <sebastian@centricular.com> | 2015-12-28 12:38:04 +0200 |
commit | e2bf84869426ff767218f0a696095401f086f7f6 (patch) | |
tree | 46df2790548496c9a2224b120b5793718035988f | |
parent | 6b06666065bb6ec624aaea8589b4458488973b85 (diff) | |
download | gstreamer-plugins-base-e2bf84869426ff767218f0a696095401f086f7f6.tar.gz |
playsink: Don't leak audio/video filters due to floating references weirdness
The filters' floating references are sinked during set_property() already,
which means that GstBin takes a new reference when adding the filter to it.
Get rid of the additional reference after adding the filter to the bin.
-rw-r--r-- | gst/playback/gstplaysink.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/gst/playback/gstplaysink.c b/gst/playback/gstplaysink.c index 3b5de5543..c2308678c 100644 --- a/gst/playback/gstplaysink.c +++ b/gst/playback/gstplaysink.c @@ -1843,6 +1843,9 @@ gen_video_chain (GstPlaySink * playsink, gboolean raw, gboolean async) } gst_bin_add (bin, chain->filter); + /* Bin takes a new reference because we sinked any + * floating reference ourselves already */ + gst_object_unref (chain->filter); if (prev) { if (!gst_element_link_pads_full (prev, "src", chain->filter, "sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) { @@ -2721,6 +2724,9 @@ gen_audio_chain (GstPlaySink * playsink, gboolean raw) } gst_bin_add (bin, chain->filter); + /* Bin takes a new reference because we sinked any + * floating reference ourselves already */ + gst_object_unref (chain->filter); if (prev) { if (!gst_element_link_pads_full (prev, "src", chain->filter, "sink", GST_PAD_LINK_CHECK_TEMPLATE_CAPS)) { |