mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-02-21 21:46:22 +00:00
multiqueue: post 100% buffering if single queue is not linked
This makes buffering stop in case a stream switch happens. This is important for adaptive streams that can disable not-linked streams to avoid consuming the network bandwidth. https://bugzilla.gnome.org/show_bug.cgi?id=719575
This commit is contained in:
parent
df459aa3c5
commit
1c7809bc0d
1 changed files with 7 additions and 1 deletions
|
@ -836,7 +836,7 @@ update_buffering (GstMultiQueue * mq, GstSingleQueue * sq)
|
||||||
size.bytes, sq->max_size.bytes, sq->cur_time, sq->max_size.time);
|
size.bytes, sq->max_size.bytes, sq->cur_time, sq->max_size.time);
|
||||||
|
|
||||||
/* get bytes and time percentages and take the max */
|
/* get bytes and time percentages and take the max */
|
||||||
if (sq->is_eos) {
|
if (sq->is_eos || sq->srcresult == GST_FLOW_NOT_LINKED) {
|
||||||
percent = 100;
|
percent = 100;
|
||||||
} else {
|
} else {
|
||||||
percent = 0;
|
percent = 0;
|
||||||
|
@ -1197,6 +1197,7 @@ gst_multi_queue_loop (GstPad * pad)
|
||||||
GstFlowReturn result;
|
GstFlowReturn result;
|
||||||
GstClockTime next_time;
|
GstClockTime next_time;
|
||||||
gboolean is_buffer;
|
gboolean is_buffer;
|
||||||
|
gboolean do_update_buffering = FALSE;
|
||||||
|
|
||||||
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
|
sq = (GstSingleQueue *) gst_pad_get_element_private (pad);
|
||||||
mq = sq->mqueue;
|
mq = sq->mqueue;
|
||||||
|
@ -1348,6 +1349,7 @@ gst_multi_queue_loop (GstPad * pad)
|
||||||
sq->id);
|
sq->id);
|
||||||
|
|
||||||
compute_high_id (mq);
|
compute_high_id (mq);
|
||||||
|
do_update_buffering = TRUE;
|
||||||
|
|
||||||
/* maybe no-one is waiting */
|
/* maybe no-one is waiting */
|
||||||
if (mq->numwaiting > 0) {
|
if (mq->numwaiting > 0) {
|
||||||
|
@ -1369,6 +1371,10 @@ gst_multi_queue_loop (GstPad * pad)
|
||||||
sq->pushed = TRUE;
|
sq->pushed = TRUE;
|
||||||
sq->srcresult = result;
|
sq->srcresult = result;
|
||||||
sq->last_oldid = newid;
|
sq->last_oldid = newid;
|
||||||
|
|
||||||
|
if (do_update_buffering)
|
||||||
|
update_buffering (mq, sq);
|
||||||
|
|
||||||
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
GST_MULTI_QUEUE_MUTEX_UNLOCK (mq);
|
||||||
|
|
||||||
if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED
|
if (result != GST_FLOW_OK && result != GST_FLOW_NOT_LINKED
|
||||||
|
|
Loading…
Reference in a new issue