mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-02 04:22:27 +00:00
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.
This commit is contained in:
parent
a03435dfba
commit
e472d9d261
1 changed files with 11 additions and 2 deletions
|
@ -1610,6 +1610,10 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
guint32 curid;
|
guint32 curid;
|
||||||
GstMultiQueueItem *item;
|
GstMultiQueueItem *item;
|
||||||
|
|
||||||
|
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
||||||
|
if (sq->srcresult != GST_FLOW_OK)
|
||||||
|
goto out_flushing;
|
||||||
|
|
||||||
/* Get an unique incrementing id. */
|
/* Get an unique incrementing id. */
|
||||||
curid = g_atomic_int_add ((gint *) & mq->counter, 1);
|
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,
|
GST_DEBUG_OBJECT (mq,
|
||||||
"SingleQueue %d : Enqueuing query %p of type %s with id %d",
|
"SingleQueue %d : Enqueuing query %p of type %s with id %d",
|
||||||
sq->id, query, GST_QUERY_TYPE_NAME (query), curid);
|
sq->id, query, GST_QUERY_TYPE_NAME (query), curid);
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_LOCK (mq);
|
|
||||||
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
|
res = gst_data_queue_push (sq->queue, (GstDataQueueItem *) item);
|
||||||
g_cond_wait (&sq->query_handled, &mq->qlock);
|
g_cond_wait (&sq->query_handled, &mq->qlock);
|
||||||
res = sq->last_query;
|
res = sq->last_query;
|
||||||
|
@ -1631,6 +1633,13 @@ gst_multi_queue_sink_query (GstPad * pad, GstObject * parent, GstQuery * query)
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
return res;
|
return res;
|
||||||
|
|
||||||
|
out_flushing:
|
||||||
|
{
|
||||||
|
GST_DEBUG_OBJECT (mq, "Flushing");
|
||||||
|
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||||
|
return FALSE;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue