mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 20:42:30 +00:00
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.
This commit is contained in:
parent
a136ac0e2f
commit
6a57399270
1 changed files with 6 additions and 0 deletions
|
@ -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)) {
|
||||
|
|
Loading…
Reference in a new issue