From ebeee60c3f6e4cdaf54e3d5f5569cadc5019f0f3 Mon Sep 17 00:00:00 2001 From: Edward Hervey Date: Thu, 15 Oct 2015 16:32:42 +0200 Subject: [PATCH] multiqueue: Improve incoming SEGMENT handling Previously this code was just blindly setting the cached flow return of downstream to GST_FLOW_OK when we get a SEGMENT. The problem is that this can not be done blindly. If downstream was not linked, the corresponding sinqlequeue source pad thread might be waiting for the next ID to be woken up upon. By blindly setting the cached return value to GST_FLOW_OK, and if that stream was the only one that was NOT_LINKED, then the next time we check (from any other thread) to see if we need to wake up a source pad thread ... we won't even try, because none of the cached flow return are equal to GST_FLOW_NOT_LINKED. This would result in that thread never being woken up https://bugzilla.gnome.org/show_bug.cgi?id=756645 --- plugins/elements/gstmultiqueue.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index e328fc5..479db52 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1859,7 +1859,8 @@ gst_multi_queue_sink_event (GstPad * pad, GstObject * parent, GstEvent * event) /* a new segment allows us to accept more buffers if we got EOS * from downstream */ GST_MULTI_QUEUE_MUTEX_LOCK (mq); - sq->srcresult = GST_FLOW_OK; + if (sq->srcresult == GST_FLOW_EOS) + sq->srcresult = GST_FLOW_OK; GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); break; case GST_EVENT_GAP: -- 2.7.4