diff --git a/ChangeLog b/ChangeLog index 03fc43f08b..f5c5a9c67e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2004-07-11 Andy Wingo + + * gst/gstbin.c (gst_bin_add_func): If we're adding an element + whose state is higher than the bin state, raise the bin state to + ensure that bin state := highest child state. + 2004-07-11 Andy Wingo * gst/gstbin.c (gst_bin_foreach): New static function. Calls a diff --git a/gst/gstbin.c b/gst/gstbin.c index 7e799867ee..2ed7397f8d 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -455,6 +455,12 @@ gst_bin_add_func (GstBin * bin, GstElement * element) return; } + if (GST_STATE (element) > GST_STATE (bin)) { + GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, bin, + "setting state to receive element \"%s\"", GST_OBJECT_NAME (element)); + gst_element_set_state ((GstElement *) bin, GST_STATE (element)); + } + /* set the element's parent and add the element to the bin's list of children */ gst_object_set_parent (GST_OBJECT (element), GST_OBJECT (bin));