gst/gstbin.c: Check that the state_cookie hasn't changed since the continue_func was scheduled. Avoids problems where...

Original commit message from CVS:
* gst/gstbin.c: (gst_bin_continue_func):
Check that the state_cookie hasn't changed since the continue_func
was scheduled. Avoids problems where the state changes back to
something it shouldn't be because it was changed in the meantime.
This commit is contained in:
Jan Schmidt 2007-07-18 14:31:21 +00:00
parent 2a643f27d1
commit 6c0e00bba0
2 changed files with 18 additions and 0 deletions

View file

@ -1,3 +1,10 @@
2007-07-18 Jan Schmidt <thaytan@noraisin.net>
* gst/gstbin.c: (gst_bin_continue_func):
Check that the state_cookie hasn't changed since the continue_func
was scheduled. Avoids problems where the state changes back to
something it shouldn't be because it was changed in the meantime.
2007-07-17 Stefan Kost <ensonic@users.sf.net>
* gst/gstregistrybinary.c: (gst_registry_binary_save_const_string),

View file

@ -2220,6 +2220,9 @@ gst_bin_continue_func (BinContinueData * data)
GST_DEBUG_OBJECT (bin, "doing state continue");
GST_OBJECT_LOCK (bin);
if (data->cookie != GST_ELEMENT_CAST (bin)->state_cookie)
goto interrupted;
current = GST_STATE (bin);
next = GST_STATE_GET_NEXT (current, pending);
transition = (GstStateChange) GST_STATE_TRANSITION (current, next);
@ -2240,6 +2243,14 @@ gst_bin_continue_func (BinContinueData * data)
GST_DEBUG_OBJECT (bin, "state continue done");
gst_object_unref (bin);
g_free (data);
return;
interrupted:
GST_OBJECT_UNLOCK (bin);
GST_STATE_UNLOCK (bin);
GST_DEBUG_OBJECT (bin, "state continue aborted due to intervening change");
gst_object_unref (bin);
g_free (data);
}
static GstBusSyncReply