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.
This commit is contained in:
Edward Hervey 2012-03-29 17:44:02 +02:00
parent c36748177f
commit 2bdd71a710

View file

@ -1163,7 +1163,10 @@ out_flushing:
gst_pad_pause_task (queue->srcpad); gst_pad_pause_task (queue->srcpad);
GST_CAT_LOG_OBJECT (queue_dataflow, queue, GST_CAT_LOG_OBJECT (queue_dataflow, queue,
"pause task, reason: %s", gst_flow_get_name (ret)); "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); GST_QUEUE_MUTEX_UNLOCK (queue);
/* let app know about us giving up if upstream is not expected to do so */ /* let app know about us giving up if upstream is not expected to do so */
/* EOS is already taken care of elsewhere */ /* EOS is already taken care of elsewhere */