gst/gstbin.c (gst_bin_add_func): If we're adding an element whose state is higher than the bin state, raise the bin s...

Original commit message from CVS:
2004-07-11  Andy Wingo  <wingo@pobox.com>

* 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.
This commit is contained in:
Andy Wingo 2004-07-11 12:16:29 +00:00
parent 799ee9420c
commit db1987c472
2 changed files with 12 additions and 0 deletions

View file

@ -1,3 +1,9 @@
2004-07-11 Andy Wingo <wingo@pobox.com>
* 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 <wingo@pobox.com> 2004-07-11 Andy Wingo <wingo@pobox.com>
* gst/gstbin.c (gst_bin_foreach): New static function. Calls a * gst/gstbin.c (gst_bin_foreach): New static function. Calls a

View file

@ -455,6 +455,12 @@ gst_bin_add_func (GstBin * bin, GstElement * element)
return; 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 */ /* 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)); gst_object_set_parent (GST_OBJECT (element), GST_OBJECT (bin));