mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-03-28 11:55:39 +00:00
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:
parent
2a643f27d1
commit
6c0e00bba0
2 changed files with 18 additions and 0 deletions
|
@ -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),
|
||||
|
|
11
gst/gstbin.c
11
gst/gstbin.c
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue