From f4ad5f0cdf1ad73d80584511cef1e1600fbd6071 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tim-Philipp=20M=C3=BCller?= Date: Sun, 4 Jan 2015 17:15:37 +0000 Subject: [PATCH] aggregator: don't use iterator when setting flush pending on pads --- libs/gst/base/gstaggregator.c | 26 ++++++++++++-------------- 1 file changed, 12 insertions(+), 14 deletions(-) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 000255d387..a7d2b8eb1a 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -1320,16 +1320,6 @@ gst_aggregator_event_forward_func (GstPad * pad, gpointer user_data) return FALSE; } -static gboolean -gst_aggregator_set_flush_pending (GstAggregator * self, GstAggregatorPad * pad, - gpointer udata) -{ - pad->priv->pending_flush_start = TRUE; - pad->priv->pending_flush_stop = FALSE; - - return TRUE; -} - static EventData gst_aggregator_forward_event_to_all_sinkpads (GstAggregator * self, GstEvent * event, gboolean flush) @@ -1344,9 +1334,18 @@ gst_aggregator_forward_event_to_all_sinkpads (GstAggregator * self, /* We first need to set all pads as flushing in a first pass * as flush_start flush_stop is sometimes sent synchronously * while we send the seek event */ - if (flush) - gst_aggregator_iterate_sinkpads (self, - gst_aggregator_set_flush_pending, NULL); + if (flush) { + GList *l; + + GST_OBJECT_LOCK (self); + for (l = GST_ELEMENT_CAST (self)->sinkpads; l != NULL; l = l->next) { + GstAggregatorPad *pad = l->data; + + pad->priv->pending_flush_start = TRUE; + pad->priv->pending_flush_stop = FALSE; + } + GST_OBJECT_UNLOCK (self); + } gst_pad_forward (self->srcpad, gst_aggregator_event_forward_func, &evdata); @@ -1643,7 +1642,6 @@ gst_aggregator_class_init (GstAggregatorClass * klass) GST_DEBUG_REGISTER_FUNCPTR (gst_aggregator_stop_pad); GST_DEBUG_REGISTER_FUNCPTR (gst_aggregator_query_sink_latency_foreach); - GST_DEBUG_REGISTER_FUNCPTR (gst_aggregator_set_flush_pending); } static void