mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2024-11-15 22:01:27 +00:00
multiqueue: Don't grow queue infinitely if only one pad is linked
This was introduced by https://bugzilla.gnome.org/show_bug.cgi?id=719893 https://bugzilla.gnome.org/show_bug.cgi?id=722891 but it doesn't make any sense at all and causes huge memory leaks. https://bugzilla.gnome.org/show_bug.cgi?id=744253
This commit is contained in:
parent
39435ec128
commit
1ea8c8720e
1 changed files with 5 additions and 14 deletions
|
@ -2101,7 +2101,6 @@ single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
GList *tmp;
|
||||
GstDataQueueSize size;
|
||||
gboolean filled = TRUE;
|
||||
gboolean all_not_linked = TRUE;
|
||||
gboolean empty_found = FALSE;
|
||||
|
||||
gst_data_queue_get_level (sq->queue, &size);
|
||||
|
@ -2120,7 +2119,7 @@ single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
goto done;
|
||||
}
|
||||
|
||||
/* Search for empty or unlinked queues */
|
||||
/* Search for empty queues */
|
||||
for (tmp = mq->queues; tmp; tmp = g_list_next (tmp)) {
|
||||
GstSingleQueue *oq = (GstSingleQueue *) tmp->data;
|
||||
|
||||
|
@ -2132,7 +2131,6 @@ single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
continue;
|
||||
}
|
||||
|
||||
all_not_linked = FALSE;
|
||||
GST_LOG_OBJECT (mq, "Checking Queue %d", oq->id);
|
||||
if (gst_data_queue_is_empty (oq->queue)) {
|
||||
GST_LOG_OBJECT (mq, "Queue %d is empty", oq->id);
|
||||
|
@ -2141,16 +2139,9 @@ single_queue_overrun_cb (GstDataQueue * dq, GstSingleQueue * sq)
|
|||
}
|
||||
}
|
||||
|
||||
if (!mq->queues || !mq->queues->next)
|
||||
all_not_linked = FALSE;
|
||||
|
||||
/* if hard limits are not reached then we allow one more buffer in the full
|
||||
* queue, but only if any of the other singelqueues are empty or all are
|
||||
* not linked */
|
||||
if (all_not_linked || empty_found) {
|
||||
if (all_not_linked) {
|
||||
GST_LOG_OBJECT (mq, "All other queues are not linked");
|
||||
}
|
||||
* queue, but only if any of the other singelqueues are empty */
|
||||
if (empty_found) {
|
||||
if (IS_FILLED (sq, visible, size.visible)) {
|
||||
sq->max_size.visible = size.visible + 1;
|
||||
GST_DEBUG_OBJECT (mq,
|
||||
|
|
Loading…
Reference in a new issue