[Bug 698851] playbin: ability to mix or play multiple audio and text streams simultaneously
GStreamer (bugzilla.gnome.org)
bugzilla at gnome.org
Wed May 29 09:46:37 PDT 2013
https://bugzilla.gnome.org/show_bug.cgi?id=698851
GStreamer | gst-plugins-base | git
--- Comment #40 from Brendan Long <self at brendanlong.com> 2013-05-29 16:46:33 UTC ---
Created an attachment (id=245564)
View: https://bugzilla.gnome.org/attachment.cgi?id=245564
Review: https://bugzilla.gnome.org/review?bug=698851&attachment=245564
Don't add an extra ref to custom combiners in pad_added_cb
Short version: `gst_bin_add` refs custom_combiner for us, so we don't need to
ref it ourselves.
The problem is here in `pad_added_cb`:
// custom_combiner has one ref
if (custom_combiner)
combine->combiner = gst_object_ref (custom_combiner);
else
combine->combiner = gst_element_factory_make ("input-selector", NULL);
// now custom_combiner has two refs
// default combiner has one ref
// ...
gst_bin_add (GST_BIN_CAST (playbin), combine->combiner);
// custom_combiner has three refs
// default combiner has one ref
Then in `pad_removed_cb`:
// custom combiner starts with three refs
// default combiner starts with one ref
gst_element_set_state (combine->combiner, GST_STATE_NULL);
gst_bin_remove (GST_BIN_CAST (playbin), combine->combiner);
// custom combiner has 2 refs
// default combiner has 0 refs
combine->combiner = NULL;
The problem is that we add two ref's for custom combiners and only one for
normal combiners.
I'm actually confused about where the elements are being ref'd in `gst_bin_add`
(I looked at the source and don't see it), but I can confirm that it's
happening with logging:
g_print("refs before add %d\n",
GST_OBJECT_REFCOUNT_VALUE(combine->combiner)); // 2
gst_bin_add (GST_BIN_CAST (playbin), combine->combiner);
g_print("refs after add %d\n",
GST_OBJECT_REFCOUNT_VALUE(combine->combiner)); // 3
Is the `transfer full` annotation on `gst_bin_add` correct? I thought transfer
full meant that the function doesn't add another reference.
--
Configure bugmail: https://bugzilla.gnome.org/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
You are the QA contact for the bug.
You are the assignee for the bug.
More information about the gstreamer-bugs
mailing list