gst/gstbin.c: Fix a big bug that was breaking pipelines like sinesrc ! { queue ! osssink } when an error was thrown b...

Original commit message from CVS:
2004-02-15  Julien MOUTTE  <julien@moutte.net>

* gst/gstbin.c: (gst_bin_change_state), (gst_bin_iterate): Fix a big
bug that was breaking pipelines like sinesrc ! { queue ! osssink } when
an error was thrown by osssink. Basically a state change failure for
an element in a different scheduling group was considered as successfull        , which means that caps nego was going on and weird stuff happened. Like        i wrote in the comment there, if someone want to revert that please
drop me a mail explaining why because i really see no point in keeping
that broken behaviour there.
* gst/gstqueue.c: (gst_queue_get): Add a safety check as the queue CAN
be empty, we then return NULL which will trigger a nice error when
pulling from the pad.
This commit is contained in:
Julien Moutte 2004-02-15 19:05:59 +00:00
parent 639e9ccebf
commit 0f21f59260
4 changed files with 29 additions and 9 deletions

View file

@ -1,3 +1,17 @@
2004-02-15 Julien MOUTTE <julien@moutte.net>
* gst/gstbin.c: (gst_bin_change_state), (gst_bin_iterate): Fix a big
bug that was breaking pipelines like sinesrc ! { queue ! osssink } when
an error was thrown by osssink. Basically a state change failure for
an element in a different scheduling group was considered as successfull
, which means that caps nego was going on and weird stuff happened. Like
i wrote in the comment there, if someone want to revert that please
drop me a mail explaining why because i really see no point in keeping
that broken behaviour there.
* gst/gstqueue.c: (gst_queue_get): Add a safety check as the queue CAN
be empty, we then return NULL which will trigger a nice error when
pulling from the pad.
2004-02-13 David Schleef <ds@schleef.org>
* libs/gst/control/dparam.c: (gst_dparam_class_init),

View file

@ -723,14 +723,13 @@ gst_bin_change_state (GstElement * element)
GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending));
gst_element_set_state (child, old_child_state);
/* FIXME, this is legacy code, a failed state change of a child should
* return a failure in all cases */
if (GST_ELEMENT_SCHED (child) == GST_ELEMENT_SCHED (element)) {
/* try to reset it to what is was */
GST_STATE_PENDING (element) = old_state;
return GST_STATE_FAILURE;
}
/* There was a check for elements being in the same scheduling group
here. Removed by dolphy <julien@moutte.net>. No matter the
scheduling group we should always return a failure. This change
seems to work on my machine and fixes tons of issues. If anyone
want to revert please tell me what it breaks first, Thanks. */
GST_STATE_PENDING (element) = old_state;
return GST_STATE_FAILURE;
break;
case GST_STATE_ASYNC:
GST_CAT_DEBUG (GST_CAT_STATES, "child '%s' is changing state asynchronously",
@ -738,6 +737,8 @@ gst_bin_change_state (GstElement * element)
have_async = TRUE;
break;
case GST_STATE_SUCCESS:
GST_CAT_DEBUG (GST_CAT_STATES, "child '%s' changed state to %d(%s) successfully",
GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending));
break;
}
}
@ -1134,4 +1135,3 @@ gst_bin_iterate (GstBin *bin)
return running;
}

View file

@ -719,6 +719,9 @@ restart:
data = g_queue_pop_head (queue->queue);
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
"retrieved data %p from queue", data);
if (data == NULL)
return NULL;
if (GST_IS_BUFFER (data)) {
/* Update statistics */

View file

@ -719,6 +719,9 @@ restart:
data = g_queue_pop_head (queue->queue);
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
"retrieved data %p from queue", data);
if (data == NULL)
return NULL;
if (GST_IS_BUFFER (data)) {
/* Update statistics */