Index: libs/gst/base/gstcollectpads.c
===================================================================
--- libs/gst/base/gstcollectpads.c	(revision 13)
+++ libs/gst/base/gstcollectpads.c	(revision 20)
@@ -197,6 +197,7 @@
   data->pad = pad;
   data->buffer = NULL;
   gst_segment_init (&data->segment, GST_FORMAT_UNDEFINED);
+  data->flushing = FALSE;
 
   GST_OBJECT_LOCK (pads);
   pads->data = g_slist_append (pads->data, data);
@@ -620,6 +621,30 @@
       GST_DEBUG_PAD_NAME (data->pad));
 
   switch (GST_EVENT_TYPE (event)) {
+    case GST_EVENT_FLUSH_START:
+    {
+      /* forward event to unblock is_collected */
+      gst_pad_event_default (pad, event);
+
+      /* now unblock the chain function
+      no cond per pad, so they all unblock, non-flushing block again */
+      GST_OBJECT_LOCK (pads);
+      data->flushing = TRUE;
+      GST_COLLECT_PADS_BROADCAST (pads);
+      GST_OBJECT_UNLOCK (pads);
+
+      /* event already cleaned up by forwarding */
+      return TRUE;
+    }
+    case GST_EVENT_FLUSH_STOP:
+    {
+      /* flush the 1 buffer queue */
+      GST_OBJECT_LOCK (pads);
+      data->flushing = FALSE;
+      gst_collect_pads_pop (pads, data);
+      GST_OBJECT_UNLOCK (pads);
+      goto beach;
+    }
     case GST_EVENT_EOS:
     {
       GST_OBJECT_LOCK (pads);
@@ -689,7 +714,7 @@
   GST_OBJECT_LOCK (pads);
 
   /* if not started, bail out */
-  if (!pads->started)
+  if (!pads->started || data->flushing)
     goto not_started;
 
   GST_DEBUG ("Queuing buffer %p for pad %s:%s", buffer,
@@ -710,7 +735,7 @@
     GST_COLLECT_PADS_WAIT (pads);
     GST_DEBUG ("Pad %s:%s resuming", GST_DEBUG_PAD_NAME (pad));
     /* after a signal,  we could be stopped */
-    if (!pads->started)
+    if (!pads->started || data->flushing)
       goto not_started;
   }
 
Index: libs/gst/base/gstcollectpads.h
===================================================================
--- libs/gst/base/gstcollectpads.h	(revision 13)
+++ libs/gst/base/gstcollectpads.h	(revision 20)
@@ -54,9 +54,10 @@
   GstBuffer		*buffer;
   guint			 pos;
   GstSegment             segment;
+  gboolean               flushing;
 
   /*< private >*/
-  gpointer               _gst_reserved[GST_PADDING];
+  gpointer               _gst_reserved[GST_PADDING - sizeof(gboolean)];
 };
 
 /**
