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-25 11:34:10 +0100 |
commit | 6a5739927010fb32b44c59b703f7890a16933b21 (patch) | |
tree | 5854d80a281306d81781481e2106076b2ef9e833 | |
parent | a136ac0e2f9403dedeca268f7064957b8c61d4ea (diff) |
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 ab5cff388..e126d1808 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)) { |