{
guint i, len;
GArray *events;
+ gboolean notify = FALSE;
events = pad->priv->events;
ev->event = NULL;
- if (event && GST_EVENT_TYPE (event) == GST_EVENT_CAPS) {
- GST_OBJECT_UNLOCK (pad);
-
- GST_DEBUG_OBJECT (pad, "notify caps");
- g_object_notify_by_pspec ((GObject *) pad, pspec_caps);
+ if (event && GST_EVENT_TYPE (event) == GST_EVENT_CAPS)
+ notify = TRUE;
- 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++;
+
+ if (notify) {
+ GST_OBJECT_UNLOCK (pad);
+
+ GST_DEBUG_OBJECT (pad, "notify caps");
+ g_object_notify_by_pspec ((GObject *) pad, pspec_caps);
+
+ GST_OBJECT_LOCK (pad);
+ }
}
/* should be called with object lock */