multiqueue: Protect against spurious wakeups of the condition variable
authorSebastian Dröge <sebastian@centricular.com>
Tue, 13 Dec 2016 19:12:23 +0000 (21:12 +0200)
committerSebastian Dröge <sebastian@centricular.com>
Sun, 18 Dec 2016 11:59:12 +0000 (13:59 +0200)
plugins/elements/gstmultiqueue.c

index d59acaa..fed846d 100644 (file)
@@ -2408,7 +2408,8 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
            * pushed. If it is, we don't need to wait for the condition
            * variable, otherwise we wait for the condition variable to
            * be signaled. */
-          if (sq->last_handled_query != query)
+          while (!sq->flushing && sq->srcresult == GST_FLOW_OK
+              && sq->last_handled_query != query)
             g_cond_wait (&sq->query_handled, &mq->qlock);
           res = sq->last_query;
           sq->last_handled_query = NULL;