Commit 6a573992 authored by Sebastian Dröge's avatar Sebastian Dröge

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.
parent a136ac0e
......@@ -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)) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment