From 69a37365f1cde3e84efef7c290b2d70bf569973d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Sebastian=20Dr=C3=B6ge?= Date: Tue, 10 Feb 2015 10:49:16 +0100 Subject: [PATCH] aggregator: Pause srcpad task on flow errors Otherwise we will call the task function over and over again until upstream finally handled the flow return and shuts us down. --- gst-libs/gst/base/gstaggregator.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/gst-libs/gst/base/gstaggregator.c b/gst-libs/gst/base/gstaggregator.c index 9350dfbffd..bbaa5e9fcf 100644 --- a/gst-libs/gst/base/gstaggregator.c +++ b/gst-libs/gst/base/gstaggregator.c @@ -655,6 +655,15 @@ gst_aggregator_aggregate_func (GstAggregator * self) if (flow_return != GST_FLOW_OK) break; } + + /* Pause the task here, the only ways to get here are: + * 1) We're stopping, in which case the task is stopped anyway + * 2) We got a flow error above, in which case it might take + * some time to forward the flow return upstream and we + * would otherwise call the task function over and over + * again without doing anything + */ + gst_pad_pause_task (self->srcpad); } static gboolean