multiqueue: catch errors and flushing case after lock

This ensures we can not get into an indefinite wait on the
following cond var wait.

https://bugzilla.gnome.org/show_bug.cgi?id=764999
This commit is contained in:
Vincent Penquerc'h 2016-04-13 16:08:30 +01:00
parent 939a7fee6c
commit 53a7a991e2

View file

@ -2159,6 +2159,8 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
if (!res || sq->flushing)
goto out_flushing;
/* it might be that the query has been taken out of the queue
* while we were unlocked. So, we need to check if the last
* handled query is the same one than the one we just