From c967174c17039aa6ff6f03729852c5dc5a99a262 Mon Sep 17 00:00:00 2001 From: Andy Wingo Date: Sat, 14 May 2005 15:54:49 +0000 Subject: [PATCH] gst/gstbin.c (gst_bin_change_state): Fix state changes if a bin has no sinks. Original commit message from CVS: 2005-05-14 Andy Wingo * gst/gstbin.c (gst_bin_change_state): Fix state changes if a bin has no sinks. --- ChangeLog | 5 +++++ docs/gst/tmpl/gstelement.sgml | 1 + gst/gstbin.c | 8 ++++++++ 3 files changed, 14 insertions(+) diff --git a/ChangeLog b/ChangeLog index bd0ac3df8e..f54a6fb2c2 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,8 @@ +2005-05-14 Andy Wingo + + * gst/gstbin.c (gst_bin_change_state): Fix state changes if a bin + has no sinks. + 2005-05-13 Andy Wingo * gst/gstutils.c (gst_element_link_pads): Instead of calling diff --git a/docs/gst/tmpl/gstelement.sgml b/docs/gst/tmpl/gstelement.sgml index 59986574a0..9f058d3b26 100644 --- a/docs/gst/tmpl/gstelement.sgml +++ b/docs/gst/tmpl/gstelement.sgml @@ -229,6 +229,7 @@ This enum defines the standard flags that an element may have. @GST_ELEMENT_SCHEDULER_PRIVATE1: @GST_ELEMENT_SCHEDULER_PRIVATE2: @GST_ELEMENT_LOCKED_STATE: +@GST_ELEMENT_IS_SINK: @GST_ELEMENT_FLAG_LAST: diff --git a/gst/gstbin.c b/gst/gstbin.c index 090b994bef..46d0a55821 100644 --- a/gst/gstbin.c +++ b/gst/gstbin.c @@ -899,6 +899,14 @@ restart: } GST_UNLOCK (bin); + /* can be the case for a bin like ( identity ) */ + if (g_queue_is_empty (elem_queue) && !g_queue_is_empty (temp)) { + GQueue *q = elem_queue; + + elem_queue = temp; + temp = q; + } + /* second step, change state of elements in the queue */ while (!g_queue_is_empty (elem_queue)) { GstElement *qelement;