From e0f15e666a1c0e0b6dff0f64e2590dbff770774a Mon Sep 17 00:00:00 2001 From: Mark Nauwelaerts Date: Thu, 2 Dec 2010 17:51:58 +0100 Subject: [PATCH] multiqueue: return upon input when already eos ... rather than hanging incoming thread (as considered full in eos). --- plugins/elements/gstmultiqueue.c | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 17a6f8a2d8..f21a2aa6db 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1154,6 +1154,10 @@ gst_multi_queue_chain (GstPad * pad, GstBuffer * buffer) sq = gst_pad_get_element_private (pad); mq = sq->mqueue; + /* if eos, we are always full, so avoid hanging incoming indefinitely */ + if (sq->is_eos) + goto was_eos; + /* Get a unique incrementing id */ curid = mq->counter++; @@ -1183,6 +1187,12 @@ flushing: gst_multi_queue_item_destroy (item); goto done; } +was_eos: + { + GST_DEBUG_OBJECT (mq, "we are EOS, dropping buffer, return UNEXPECTED"); + gst_buffer_unref (buffer); + return GST_FLOW_UNEXPECTED; + } } static gboolean @@ -1250,6 +1260,10 @@ gst_multi_queue_sink_event (GstPad * pad, GstEvent * event) break; } + /* if eos, we are always full, so avoid hanging incoming indefinitely */ + if (sq->is_eos) + goto was_eos; + /* Get an unique incrementing id. protected with the STREAM_LOCK, unserialized * events already got pushed and don't end up in the queue. */ curid = mq->counter++; @@ -1294,6 +1308,13 @@ flushing: gst_multi_queue_item_destroy (item); goto done; } +was_eos: + { + GST_DEBUG_OBJECT (mq, "we are EOS, dropping event, return FALSE"); + gst_event_unref (event); + res = FALSE; + goto done; + } } static GstCaps *