gstbin: Don't propagate a NULL cached index to added elements
authorJan Schmidt <thaytan@noraisin.net>
Tue, 1 Sep 2009 11:05:51 +0000 (12:05 +0100)
committerJan Schmidt <thaytan@noraisin.net>
Tue, 1 Sep 2009 11:08:17 +0000 (12:08 +0100)
When an element is added to the bin, only set the index if we have a
cached index, rather than setting a NULL index on elements that might
have a default index object of their own.

gst/gstbin.c

index 9bd3b7a..fde197d 100644 (file)
@@ -1043,7 +1043,8 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
    * a new clock will be selected */
   gst_element_set_clock (element, GST_ELEMENT_CLOCK (bin));
   /* set the cached index on the children */
-  gst_element_set_index (element, bin->priv->index);
+  if (bin->priv->index)
+    gst_element_set_index (element, bin->priv->index);
 
   ret = GST_STATE_RETURN (bin);
   /* no need to update the state if we are in error */