pad: notify caps property on NULL as well
authorWim Taymans <wim.taymans@collabora.co.uk>
Tue, 23 Apr 2013 09:17:05 +0000 (11:17 +0200)
committerWim Taymans <wim.taymans@collabora.co.uk>
Tue, 23 Apr 2013 09:17:05 +0000 (11:17 +0200)
Also notify the caps property when it changes to NULL

gst/gstpad.c

index dae9210..01f439a 100644 (file)
@@ -371,7 +371,19 @@ remove_events (GstPad * pad)
   len = events->len;
   for (i = 0; i < len; i++) {
     PadEvent *ev = &g_array_index (events, PadEvent, i);
-    gst_event_unref (ev->event);
+    GstEvent *event = ev->event;
+
+    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);
+
+      GST_OBJECT_LOCK (pad);
+    }
+    gst_event_unref (event);
   }
   GST_OBJECT_FLAG_UNSET (pad, GST_PAD_FLAG_PENDING_EVENTS);
   g_array_set_size (events, 0);