aggregator: Flush sinkpads when stopping
authorThibault Saunier <tsaunier@gnome.org>
Thu, 10 Jul 2014 11:18:21 +0000 (13:18 +0200)
committerTim-Philipp Müller <tim@centricular.com>
Sat, 2 Dec 2017 15:10:25 +0000 (15:10 +0000)
All values are meaningless in that case, so we should make sure that
we clean everything

libs/gst/base/gstaggregator.c

index c2d00ad..7eab806 100644 (file)
@@ -691,10 +691,21 @@ eat:
 }
 
 static gboolean
 }
 
 static gboolean
+_flush_pad (GstAggregator * self, GstAggregatorPad * pad, gpointer unused_udata)
+{
+  _aggpad_flush (pad, self);
+
+  return TRUE;
+}
+
+static gboolean
 _stop (GstAggregator * agg)
 {
   _reset_flow_values (agg);
 
 _stop (GstAggregator * agg)
 {
   _reset_flow_values (agg);
 
+  gst_aggregator_iterate_sinkpads (agg,
+      (GstAggregatorPadForeachFunc) _flush_pad, NULL);
+
   return TRUE;
 }
 
   return TRUE;
 }