multiqueue: Protect against spurious wakeups of the condition variable

This commit is contained in:
Sebastian Dröge 2016-12-13 21:12:23 +02:00
parent de65529d52
commit 47f9223750

View 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;