gst/gstelement.c: When the state did not change, also report NO_PREROLL when it matters.

Original commit message from CVS:
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_set_state), (gst_element_change_state):
When the state did not change, also report NO_PREROLL
when it matters.
This commit is contained in:
Wim Taymans 2005-06-23 17:11:49 +00:00
parent d56ab76d57
commit 52a445a41d
2 changed files with 17 additions and 6 deletions

View file

@ -1,3 +1,10 @@
2005-06-23 Wim Taymans <wim@fluendo.com>
* gst/gstelement.c: (gst_element_get_state_func),
(gst_element_set_state), (gst_element_change_state):
When the state did not change, also report NO_PREROLL
when it matters.
2005-06-23 Wim Taymans <wim@fluendo.com>
* gst/gstpad.c: (gst_pad_event_default):

View file

@ -1690,11 +1690,6 @@ gst_element_set_state (GstElement * element, GstElementState state)
gst_element_commit_state (element);
}
/* clear the error flag */
GST_STATE_ERROR (element) = FALSE;
/* clear the no_preroll flag */
GST_STATE_NO_PREROLL (element) = FALSE;
/* start with the current state */
current = GST_STATE (element);
@ -1732,6 +1727,12 @@ gst_element_set_state (GstElement * element, GstElementState state)
else
return_val = GST_STATE_FAILURE;
/* clear the error and preroll flag, we need to do that after
* calling the virtual change_state function so that it can use the
* old previous value. */
GST_STATE_ERROR (element) = FALSE;
GST_STATE_NO_PREROLL (element) = FALSE;
switch (return_val) {
case GST_STATE_FAILURE:
GST_CAT_INFO_OBJECT (GST_CAT_STATES, element,
@ -1900,7 +1901,10 @@ gst_element_change_state (GstElement * element)
GST_CAT_DEBUG_OBJECT (GST_CAT_STATES, element,
"element is already in the %s state",
gst_element_state_get_name (old_state));
return GST_STATE_SUCCESS;
if (GST_STATE_NO_PREROLL (element))
return GST_STATE_NO_PREROLL;
else
return GST_STATE_SUCCESS;
}
GST_CAT_LOG_OBJECT (GST_CAT_STATES, element,