From 2bdd71a710fcb034b327c67b00d334e1cc46cb1d Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 29 Mar 2012 17:44:02 +0200 Subject: [PATCH] queue: Flush the internal queue when we see GST_FLOW_FLUSHING 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 | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstqueue.c b/plugins/elements/gstqueue.c index 69b7e3b..191f577 100644 --- a/plugins/elements/gstqueue.c +++ b/plugins/elements/gstqueue.c @@ -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 */ -- 2.7.4