aggregator: Pause srcpad task on flow errors
authorSebastian Dröge <sebastian@centricular.com>
Tue, 10 Feb 2015 09:49:16 +0000 (10:49 +0100)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:26 +0000 (15:10 +0000)
Otherwise we will call the task function over and over again until
upstream finally handled the flow return and shuts us down.

libs/gst/base/gstaggregator.c

index 9350dfb..bbaa5e9 100644 (file)
@@ -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