queue2: Signal the sinkpad thread if a flow error happened
authorSebastian Dröge <sebastian@centricular.com>
Tue, 3 Mar 2015 11:53:13 +0000 (12:53 +0100)
committerSebastian Dröge <sebastian@centricular.com>
Tue, 3 Mar 2015 11:53:13 +0000 (12:53 +0100)
It might still be waiting for a query to be handled, or the queue to become
empty again for the next item. Also if downstream returns FLUSHING, flush the
queue like we do in queue and multiqueue.

plugins/elements/gstqueue2.c

index 19c9ce3..7ac1e4e 100644 (file)
@@ -2812,6 +2812,13 @@ out_flushing:
     GstFlowReturn ret = queue->srcresult;
 
     gst_pad_pause_task (queue->srcpad);
+    if (ret == GST_FLOW_FLUSHING) {
+      gst_queue2_locked_flush (queue, FALSE, FALSE);
+    } else {
+      GST_QUEUE2_SIGNAL_DEL (queue);
+      queue->last_query = FALSE;
+      g_cond_signal (&queue->query_handled);
+    }
     GST_QUEUE2_MUTEX_UNLOCK (queue);
     GST_CAT_LOG_OBJECT (queue_dataflow, queue,
         "pause task, reason:  %s", gst_flow_get_name (queue->srcresult));