From 8c99412a0d3fbd147913229b74bb3beab18b1085 Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Fri, 9 Mar 2012 14:16:03 +0100 Subject: [PATCH] playbin2: do not take a superfluous ref on uridecodebin instances ... which are no longer FLOATING. --- gst/playback/gstplaybin2.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gst/playback/gstplaybin2.c b/gst/playback/gstplaybin2.c index 0ed8b3ac87..d5e7d36221 100644 --- a/gst/playback/gstplaybin2.c +++ b/gst/playback/gstplaybin2.c @@ -3541,7 +3541,10 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target) GST_DEBUG_OBJECT (playbin, "reusing existing uridecodebin"); uridecodebin = group->uridecodebin; gst_element_set_state (uridecodebin, GST_STATE_READY); - gst_bin_add (GST_BIN_CAST (playbin), gst_object_ref (uridecodebin)); + /* no need to take extra ref, we already have one + * and the bin will add one since it is no longer floating, + * as it was at least added once before (below) */ + gst_bin_add (GST_BIN_CAST (playbin), uridecodebin); } else { GST_DEBUG_OBJECT (playbin, "making new uridecodebin"); uridecodebin = gst_element_factory_make ("uridecodebin", NULL); @@ -3604,7 +3607,10 @@ activate_group (GstPlayBin * playbin, GstSourceGroup * group, GstState target) GST_DEBUG_OBJECT (playbin, "reusing existing suburidecodebin"); suburidecodebin = group->suburidecodebin; gst_element_set_state (suburidecodebin, GST_STATE_READY); - gst_bin_add (GST_BIN_CAST (playbin), gst_object_ref (suburidecodebin)); + /* no need to take extra ref, we already have one + * and the bin will add one since it is no longer floating, + * as it was at least added once before (below) */ + gst_bin_add (GST_BIN_CAST (playbin), suburidecodebin); } else { GST_DEBUG_OBJECT (playbin, "making new suburidecodebin"); suburidecodebin = gst_element_factory_make ("uridecodebin", NULL);