pad: don't store events on flushing pads
authorWim Taymans <wim.taymans@collabora.co.uk>
Wed, 9 Nov 2011 16:43:49 +0000 (17:43 +0100)
committerWim Taymans <wim.taymans@collabora.co.uk>
Wed, 9 Nov 2011 16:43:49 +0000 (17:43 +0100)
check the flushing state of the pad before storing the event.

gst/gstpad.c

index 74b9685..8ac8d98 100644 (file)
@@ -4450,6 +4450,9 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
       GST_CAT_DEBUG_OBJECT (GST_CAT_EVENT, pad, "have event type %s",
           GST_EVENT_TYPE_NAME (event));
 
+      if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
+        goto flushing;
+
       if (serialized) {
         /* lock order: STREAM_LOCK, LOCK, recheck flushing. */
         GST_OBJECT_UNLOCK (pad);
@@ -4499,9 +4502,6 @@ gst_pad_send_event (GstPad * pad, GstEvent * event)
         }
       }
       /* now do the probe */
-      if (G_UNLIKELY (GST_PAD_IS_FLUSHING (pad)))
-        goto flushing;
-
       PROBE_PUSH (pad,
           type | GST_PAD_PROBE_TYPE_PUSH |
           GST_PAD_PROBE_TYPE_BLOCK, event, probe_stopped);