queue: Flush the internal queue when we see GST_FLOW_FLUSHING
authorEdward Hervey <edward.hervey@collabora.co.uk>
Thu, 29 Mar 2012 15:44:02 +0000 (17:44 +0200)
committerEdward Hervey <edward.hervey@collabora.co.uk>
Thu, 29 Mar 2012 15:46:35 +0000 (17:46 +0200)
Ensures that we don't end up with stale contents (like GstQuery) in
the internal GQueue after any blocking upstream thread returns.

plugins/elements/gstqueue.c

index 69b7e3b..191f577 100644 (file)
@@ -1163,7 +1163,10 @@ out_flushing:
     gst_pad_pause_task (queue->srcpad);
     GST_CAT_LOG_OBJECT (queue_dataflow, queue,
         "pause task, reason:  %s", gst_flow_get_name (ret));
-    GST_QUEUE_SIGNAL_DEL (queue);
+    if (ret == GST_FLOW_FLUSHING)
+      gst_queue_locked_flush (queue);
+    else
+      GST_QUEUE_SIGNAL_DEL (queue);
     GST_QUEUE_MUTEX_UNLOCK (queue);
     /* let app know about us giving up if upstream is not expected to do so */
     /* EOS is already taken care of elsewhere */