diff options
author | Stefan Sauer <ensonic@users.sf.net> | 2017-09-17 12:25:37 -0700 |
---|---|---|
committer | Tim-Philipp Müller <tim@centricular.com> | 2017-12-02 15:10:27 +0000 |
commit | 06d62ccb94f1508663c6f0dc47b1167d00819de9 (patch) | |
tree | 17c6a9ddd97f3c89e86510da88db214d914ac637 | |
parent | 1869886a963a3e65473fed78daa98e9b66ff6ed5 (diff) |
aggregator: rename check_events
This function also handles queries. Update the code to loop until all events and
queuries are handled.
-rw-r--r-- | libs/gst/base/gstaggregator.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 77527c924..f3c7d8511 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -750,7 +750,8 @@ gst_aggregator_wait_and_check (GstAggregator * self, gboolean * timeout) } static gboolean -check_events (GstAggregator * self, GstAggregatorPad * pad, gpointer user_data) +do_events_and_queries (GstAggregator * self, GstAggregatorPad * pad, + gpointer user_data) { GstEvent *event = NULL; GstQuery *query = NULL; @@ -759,6 +760,7 @@ check_events (GstAggregator * self, GstAggregatorPad * pad, gpointer user_data) do { event = NULL; + query = NULL; PAD_LOCK (pad); if (pad->priv->num_buffers == 0 && pad->priv->pending_eos) { @@ -792,9 +794,7 @@ check_events (GstAggregator * self, GstAggregatorPad * pad, gpointer user_data) if (g_queue_peek_tail (&pad->priv->data) == event) gst_event_unref (g_queue_pop_tail (&pad->priv->data)); gst_event_unref (event); - } - - if (query) { + } else if (query) { GST_LOG_OBJECT (pad, "Processing %" GST_PTR_FORMAT, query); ret = klass->sink_query (self, pad, query); @@ -812,7 +812,7 @@ check_events (GstAggregator * self, GstAggregatorPad * pad, gpointer user_data) PAD_BROADCAST_EVENT (pad); PAD_UNLOCK (pad); } - } while (event != NULL); + } while (event || query); return TRUE; } @@ -1096,12 +1096,13 @@ gst_aggregator_aggregate_func (GstAggregator * self) GstFlowReturn flow_return = GST_FLOW_OK; gboolean processed_event = FALSE; - gst_aggregator_iterate_sinkpads (self, check_events, NULL); + gst_aggregator_iterate_sinkpads (self, do_events_and_queries, NULL); if (!gst_aggregator_wait_and_check (self, &timeout)) continue; - gst_aggregator_iterate_sinkpads (self, check_events, &processed_event); + gst_aggregator_iterate_sinkpads (self, do_events_and_queries, + &processed_event); if (processed_event) continue; |