From 139c96c129149266669c9799ad3b30d84f62065b Mon Sep 17 00:00:00 2001 From: Thiago Santos Date: Wed, 15 Jan 2014 00:12:26 -0300 Subject: [PATCH] multiqueue: prevent buffering forever with playbin When prerolling/buffering, multiqueue has its buffers limit set to 0, this means it can take an infinite amount of buffers. When prerolling/buffering finishes, its limit is set back to 5, but only if the current level is lower than 5. It should (almost) never be and this will cause prerolling/buffering to need to wait to reach the hard bytes and time limits, which are much higher. This can lead to a very long startup time. This patch fixes this by setting the single queues to the max(current, new_value) instead of simply ignoring the new value and letting it as infinite(0) https://bugzilla.gnome.org/show_bug.cgi?id=712597 --- plugins/elements/gstmultiqueue.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/plugins/elements/gstmultiqueue.c b/plugins/elements/gstmultiqueue.c index 5b3b5f219f..434902f61d 100644 --- a/plugins/elements/gstmultiqueue.c +++ b/plugins/elements/gstmultiqueue.c @@ -508,8 +508,11 @@ gst_multi_queue_set_property (GObject * object, guint prop_id, gst_data_queue_get_level (q->queue, &size); /* do not reduce max size below current level if the single queue has grown because of empty queue */ - if (new_size >= size.visible && size.visible <= mq->max_size.visible) + if (new_size == 0) { q->max_size.visible = new_size; + } else { + q->max_size.visible = MAX (new_size, size.visible); + } tmp = g_list_next (tmp); };