mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-09 00:45:56 +00:00
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:
parent
639e9ccebf
commit
0f21f59260
4 changed files with 29 additions and 9 deletions
14
ChangeLog
14
ChangeLog
|
@ -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>
|
2004-02-13 David Schleef <ds@schleef.org>
|
||||||
|
|
||||||
* libs/gst/control/dparam.c: (gst_dparam_class_init),
|
* libs/gst/control/dparam.c: (gst_dparam_class_init),
|
||||||
|
|
18
gst/gstbin.c
18
gst/gstbin.c
|
@ -723,14 +723,13 @@ gst_bin_change_state (GstElement * element)
|
||||||
GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending));
|
GST_ELEMENT_NAME (child), pending, gst_element_state_get_name (pending));
|
||||||
|
|
||||||
gst_element_set_state (child, old_child_state);
|
gst_element_set_state (child, old_child_state);
|
||||||
/* FIXME, this is legacy code, a failed state change of a child should
|
/* There was a check for elements being in the same scheduling group
|
||||||
* return a failure in all cases */
|
here. Removed by dolphy <julien@moutte.net>. No matter the
|
||||||
if (GST_ELEMENT_SCHED (child) == GST_ELEMENT_SCHED (element)) {
|
scheduling group we should always return a failure. This change
|
||||||
/* try to reset it to what is was */
|
seems to work on my machine and fixes tons of issues. If anyone
|
||||||
GST_STATE_PENDING (element) = old_state;
|
want to revert please tell me what it breaks first, Thanks. */
|
||||||
|
GST_STATE_PENDING (element) = old_state;
|
||||||
return GST_STATE_FAILURE;
|
return GST_STATE_FAILURE;
|
||||||
}
|
|
||||||
break;
|
break;
|
||||||
case GST_STATE_ASYNC:
|
case GST_STATE_ASYNC:
|
||||||
GST_CAT_DEBUG (GST_CAT_STATES, "child '%s' is changing state asynchronously",
|
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;
|
have_async = TRUE;
|
||||||
break;
|
break;
|
||||||
case GST_STATE_SUCCESS:
|
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;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1134,4 +1135,3 @@ gst_bin_iterate (GstBin *bin)
|
||||||
|
|
||||||
return running;
|
return running;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -719,6 +719,9 @@ restart:
|
||||||
data = g_queue_pop_head (queue->queue);
|
data = g_queue_pop_head (queue->queue);
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
|
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
|
||||||
"retrieved data %p from queue", data);
|
"retrieved data %p from queue", data);
|
||||||
|
|
||||||
|
if (data == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (GST_IS_BUFFER (data)) {
|
if (GST_IS_BUFFER (data)) {
|
||||||
/* Update statistics */
|
/* Update statistics */
|
||||||
|
|
|
@ -719,6 +719,9 @@ restart:
|
||||||
data = g_queue_pop_head (queue->queue);
|
data = g_queue_pop_head (queue->queue);
|
||||||
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
|
GST_CAT_LOG_OBJECT (GST_CAT_DATAFLOW, queue,
|
||||||
"retrieved data %p from queue", data);
|
"retrieved data %p from queue", data);
|
||||||
|
|
||||||
|
if (data == NULL)
|
||||||
|
return NULL;
|
||||||
|
|
||||||
if (GST_IS_BUFFER (data)) {
|
if (GST_IS_BUFFER (data)) {
|
||||||
/* Update statistics */
|
/* Update statistics */
|
||||||
|
|
Loading…
Reference in a new issue