summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-27 16:22:00 +0200
committerSebastian Dröge <sebastian.droege@collabora.co.uk>2013-05-27 16:22:00 +0200
commite472d9d261de6023d0eecfbe61f8353e20c76c28 (patch)
tree049c74a2b93f27748d70c71c164af84d9a765382 /plugins
parenta03435dfba789356686ebcbe070975d6e655323e (diff)
multiqueue: Don't do serialized queries when we're flushing
Just immediately fail the query, otherwise we would wait forever for the query to be answered.
Diffstat (limited to 'plugins')
-rw-r--r--plugins/elements/gstmultiqueue.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c
index 1f258e80b..9a87e2c1b 100644
--- a/plugins/elements/gstmultiqueue.c
+++ b/plugins/elements/gstmultiqueue.c
@@ -1610,6 +1610,10 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
guint32 curid;
GstMultiQueueItem *item;
+ GST_MULTI_QUEUE_MUTEX_LOCK (mq);
+ if (sq->srcresult != GST_FLOW_OK)
+ goto out_flushing;
+
/* Get an unique incrementing id. */
curid = g_atomic_int_add ((gint *) & mq->counter, 1);
@@ -1618,8 +1622,6 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
GST_DEBUG_OBJECT (mq,
"SingleQueue %d : Enqueuing query %p of type %s with id %d",
sq->id, query, GST_QUERY_TYPE_NAME (query), curid);
-
- GST_MULTI_QUEUE_MUTEX_LOCK (mq);
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
g_cond_wait (&sq->query_handled, &mq->qlock);
res = sq->last_query;
@@ -1631,6 +1633,13 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
break;
}
return res;
+
+out_flushing:
+ {
+ GST_DEBUG_OBJECT (mq, "Flushing");
+ GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
+ return FALSE;
+ }
}
static gboolean