collectpads: do not unref flush_start twice
authorMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Mon, 23 Apr 2012 15:04:57 +0000 (17:04 +0200)
committerMark Nauwelaerts <mark.nauwelaerts@collabora.co.uk>
Mon, 23 Apr 2012 15:04:57 +0000 (17:04 +0200)
Based on patch by Matej Knopp <matej.knopp@gmail.com>

libs/gst/base/gstcollectpads.c

index 5eb5f5a..f40463c 100644 (file)
@@ -1722,6 +1722,7 @@ gst_collect_pads_event_default (GstCollectPads * pads, GstCollectData * data,
       /* forward event to unblock check_collected */
       GST_DEBUG_OBJECT (pad, "forwarding flush start");
       res = gst_pad_event_default (pad, parent, event);
+      event = NULL;
 
       /* now unblock the chain function.
        * no cond per pad, so they all unblock,
@@ -1846,7 +1847,8 @@ gst_collect_pads_event_default (GstCollectPads * pads, GstCollectData * data,
   }
 
 eat:
-  gst_event_unref (event);
+  if (event)
+    gst_event_unref (event);
   return res;
 
 forward: