+2006-06-30 Tim-Philipp Müller <tim at centricular dot net>
+
+ * gst/gstbin.c: (gst_bin_restore_thyself):
+ * gst/gstxml.c: (gst_xml_make_element):
+ Fix deserialisation from XML. Set parent manually
+ instead of using gst_bin_add(), since gst_bin_add()
+ will unlink all pads of the element being added.
+ Fixes #341667.
+
2006-06-28 Tim-Philipp Müller <tim at centricular dot net>
Patch by: Peter Kjellerstedt <pkj at axis com>
childlist = field->xmlChildrenNode;
while (childlist) {
if (!strcmp ((char *) childlist->name, "element")) {
- GstElement *element =
- gst_xml_make_element (childlist, GST_OBJECT (bin));
-
- /* it had to be parented to find the pads, now we ref and unparent so
- * we can add it to the bin */
- gst_object_ref (element);
- gst_object_unparent (GST_OBJECT (element));
-
- gst_bin_add (bin, element);
+ /* gst_xml_make_element will gst_bin_add() the element to ourself */
+ gst_xml_make_element (childlist, GST_OBJECT (bin));
}
childlist = childlist->next;
}
/* ne need to set the parent on this object bacause the pads */
/* will go through the hierarchy to link to their peers */
- if (parent)
- gst_object_set_parent (GST_OBJECT (element), parent);
+ if (parent) {
+ if (GST_IS_BIN (parent)) {
+ gst_bin_add (GST_BIN (parent), element);
+ } else {
+ gst_object_set_parent (GST_OBJECT (element), parent);
+ }
+ }
gst_object_restore_thyself (GST_OBJECT (element), cur);