signal EOS on parent bins, when the last element playing sends EOS

Original commit message from CVS:
signal EOS on parent bins, when the last element playing sends EOS
This commit is contained in:
Benjamin Otte 2003-04-12 13:38:32 +00:00
parent 5706980d33
commit 0c6387ce5f

View file

@ -2794,14 +2794,26 @@ gst_element_set_loop_function (GstElement *element,
void void
gst_element_set_eos (GstElement *element) gst_element_set_eos (GstElement *element)
{ {
GstElement *parent;
GstElementState parent_state;
g_return_if_fail (GST_IS_ELEMENT (element)); g_return_if_fail (GST_IS_ELEMENT (element));
GST_DEBUG (GST_CAT_EVENT, "setting EOS on element %s", GST_DEBUG (GST_CAT_EVENT, "setting EOS on element %s",
GST_OBJECT_NAME (element)); GST_OBJECT_NAME (element));
parent = GST_ELEMENT (GST_OBJECT_PARENT (element));
if (parent)
parent_state = GST_STATE (parent);
gst_element_set_state (element, GST_STATE_PAUSED); gst_element_set_state (element, GST_STATE_PAUSED);
g_signal_emit (G_OBJECT (element), gst_element_signals[EOS], 0); g_signal_emit (G_OBJECT (element), gst_element_signals[EOS], 0);
if (parent && parent_state == GST_STATE_PLAYING &&
GST_STATE (parent) == GST_STATE_PAUSED) {
gst_element_set_eos (parent);
}
} }