collectpads: Properly handle flushing pads.
authorEdward Hervey <bilboed@bilboed.com>
Thu, 18 Jun 2009 14:41:46 +0000 (16:41 +0200)
committerEdward Hervey <bilboed@bilboed.com>
Thu, 18 Jun 2009 14:43:27 +0000 (16:43 +0200)
If a pad is flushing, it should not be considered as either eos or
containing data.

libs/gst/base/gstcollectpads.c

index 268066a..20cc8db 100644 (file)
@@ -988,10 +988,12 @@ gst_collect_pads_check_pads (GstCollectPads * pads)
       /* update the stats */
       pads->numpads++;
       data = collected->data;
-      if (data->buffer)
-        pads->queuedpads++;
-      if (data->abidata.ABI.eos)
-        pads->eospads++;
+      if (G_LIKELY (!GST_PAD_IS_FLUSHING (data->pad))) {
+        if (data->buffer)
+          pads->queuedpads++;
+        if (data->abidata.ABI.eos)
+          pads->eospads++;
+      }
 
       /* add to the list of pads to collect */
       ref_data (data);