diff options
author | Edward Hervey <edward@centricular.com> | 2016-07-01 10:44:12 +0300 |
---|---|---|
committer | Edward Hervey <bilboed@bilboed.com> | 2016-07-01 12:05:52 +0300 |
commit | 17ab616653a41006a230d1b519e4b79d5d609ac7 (patch) | |
tree | 2ab8f35ce0f0d384f6d51775c1dce73411f11a63 | |
parent | 046551105b8d47f1f2fb0f856ff12531d0f5aa08 (diff) |
multiqueue: Fix behaviour with not-linked and eos pads
This is an update on c9b6848885f4675d447e823c8fb117e247658252
multiqueue: Fix not-linked pad handling at EOS
While that commit did fix the behaviour if upstream sent a GST_EVENT_EOS,
it would break the same issue when *downstream* returns GST_FLOW_EOS
(which can happen for example when downstream decoders receive data
from after the segment stop).
GST_PAD_IS_EOS() is only TRUE when a GST_EVENT_EOS has flown through it
and not when a GST_EVENT_EOS has gone through it.
In order to handle both cases, also take into account the last flow
return.
https://bugzilla.gnome.org/show_bug.cgi?id=763770
-rw-r--r-- | plugins/elements/gstmultiqueue.c | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 9a1ab18452..78bca73f71 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -1766,12 +1766,13 @@ next: GST_MULTI_QUEUE_MUTEX_UNLOCK (mq); gst_multi_queue_post_buffering (mq); - GST_LOG_OBJECT (mq, "sq:%d AFTER PUSHING sq->srcresult: %s", sq->id, - gst_flow_get_name (sq->srcresult)); + GST_LOG_OBJECT (mq, "sq:%d AFTER PUSHING sq->srcresult: %s (is_eos:%d)", + sq->id, gst_flow_get_name (sq->srcresult), GST_PAD_IS_EOS (sq->srcpad)); /* Need to make sure wake up any sleeping pads when we exit */ GST_MULTI_QUEUE_MUTEX_LOCK (mq); - if (mq->numwaiting > 0 && GST_PAD_IS_EOS (sq->srcpad)) { + if (mq->numwaiting > 0 && (GST_PAD_IS_EOS (sq->srcpad) + || sq->srcresult == GST_FLOW_EOS)) { compute_high_time (mq); compute_high_id (mq); wake_up_next_non_linked (mq); @@ -2348,7 +2349,7 @@ compute_high_id (GstMultiQueue * mq) if (sq->nextid < lowest) lowest = sq->nextid; - } else if (!GST_PAD_IS_EOS (sq->srcpad)) { + } else if (!GST_PAD_IS_EOS (sq->srcpad) && sq->srcresult != GST_FLOW_EOS) { /* If we don't have a global highid, or the global highid is lower than * this single queue's last outputted id, store the queue's one, * unless the singlequeue output is at EOS */ @@ -2398,7 +2399,7 @@ compute_high_time (GstMultiQueue * mq) if (lowest == GST_CLOCK_STIME_NONE || sq->next_time < lowest) lowest = sq->next_time; - } else if (!GST_PAD_IS_EOS (sq->srcpad)) { + } else if (!GST_PAD_IS_EOS (sq->srcpad) && sq->srcresult != GST_FLOW_EOS) { /* If we don't have a global high time, or the global high time * is lower than this single queue's last outputted time, store * the queue's one, unless the singlequeue output is at EOS. */ |