mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-19 00:01:23 +00:00
pad: Don't unlock while iterating over all sticky events for removal
Otherwise we might end up getting the event removed from elsewhere at the same time while we're unlocked for g_object_notify(). https://bugzilla.gnome.org/show_bug.cgi?id=732556
This commit is contained in:
parent
b5936efc98
commit
d0a808cdc8
1 changed files with 13 additions and 7 deletions
18
gst/gstpad.c
18
gst/gstpad.c
|
@ -399,6 +399,7 @@ remove_events (GstPad * pad)
|
||||||
{
|
{
|
||||||
guint i, len;
|
guint i, len;
|
||||||
GArray *events;
|
GArray *events;
|
||||||
|
gboolean notify = FALSE;
|
||||||
|
|
||||||
events = pad->priv->events;
|
events = pad->priv->events;
|
||||||
|
|
||||||
|
@ -409,7 +410,17 @@ remove_events (GstPad * pad)
|
||||||
|
|
||||||
ev->event = NULL;
|
ev->event = NULL;
|
||||||
|
|
||||||
if (event && GST_EVENT_TYPE (event) == GST_EVENT_CAPS) {
|
if (event && GST_EVENT_TYPE (event) == GST_EVENT_CAPS)
|
||||||
|
notify = TRUE;
|
||||||
|
|
||||||
|
gst_event_unref (event);
|
||||||
|
}
|
||||||
|
|
||||||
|
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
|
||||||
|
g_array_set_size (events, 0);
|
||||||
|
pad->priv->events_cookie++;
|
||||||
|
|
||||||
|
if (notify) {
|
||||||
GST_OBJECT_UNLOCK (pad);
|
GST_OBJECT_UNLOCK (pad);
|
||||||
|
|
||||||
GST_DEBUG_OBJECT (pad, "notify caps");
|
GST_DEBUG_OBJECT (pad, "notify caps");
|
||||||
|
@ -417,11 +428,6 @@ remove_events (GstPad * pad)
|
||||||
|
|
||||||
GST_OBJECT_LOCK (pad);
|
GST_OBJECT_LOCK (pad);
|
||||||
}
|
}
|
||||||
gst_event_unref (event);
|
|
||||||
}
|
|
||||||
GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
|
|
||||||
g_array_set_size (events, 0);
|
|
||||||
pad->priv->events_cookie++;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* should be called with object lock */
|
/* should be called with object lock */
|
||||||
|
|
Loading…
Reference in a new issue