mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-17 11:45:25 +00:00
nleobject: Start up in NULL->READY->PAUSED after the parent class did
This keeps everything in a more consistent order and makes sure that the base class is already set up completely before we start doing anything. It also prevents from doing any setup if the base class fails, and possibly not shutting things down again then. https://bugzilla.gnome.org/show_bug.cgi?id=774480
This commit is contained in:
parent
57d40bec1a
commit
5f7943c59d
1 changed files with 14 additions and 19 deletions
|
@ -630,7 +630,21 @@ nle_object_change_state (GstElement * element, GstStateChange transition)
|
|||
{
|
||||
GstStateChangeReturn ret = GST_STATE_CHANGE_SUCCESS;
|
||||
|
||||
GST_DEBUG_OBJECT (element, "Calling parent change_state");
|
||||
|
||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||
|
||||
GST_DEBUG_OBJECT (element, "Return from parent change_state was %d", ret);
|
||||
|
||||
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||
goto beach;
|
||||
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
/* cleanup nleobject */
|
||||
if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
break;
|
||||
case GST_STATE_CHANGE_NULL_TO_READY:
|
||||
{
|
||||
GstObject *parent = gst_object_get_parent (GST_OBJECT (element));
|
||||
|
@ -659,25 +673,6 @@ nle_object_change_state (GstElement * element, GstStateChange transition)
|
|||
break;
|
||||
}
|
||||
|
||||
GST_DEBUG_OBJECT (element, "Calling parent change_state");
|
||||
|
||||
ret = GST_ELEMENT_CLASS (parent_class)->change_state (element, transition);
|
||||
|
||||
GST_DEBUG_OBJECT (element, "Return from parent change_state was %d", ret);
|
||||
|
||||
if (ret == GST_STATE_CHANGE_FAILURE)
|
||||
goto beach;
|
||||
|
||||
switch (transition) {
|
||||
case GST_STATE_CHANGE_PAUSED_TO_READY:
|
||||
/* cleanup nleobject */
|
||||
if (nle_object_cleanup (NLE_OBJECT (element)) == GST_STATE_CHANGE_FAILURE)
|
||||
ret = GST_STATE_CHANGE_FAILURE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
}
|
||||
|
||||
beach:
|
||||
return ret;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue