From a82e6bc650dac35c1cce6021eb555e5151a6a496 Mon Sep 17 00:00:00 2001 From: Stefan Sauer Date: Tue, 3 Oct 2017 12:08:42 +0200 Subject: [PATCH] aggregator: simplify src_event Avoid extra ref/unref, we have a ref and do_seek unrefs. Just return the result as we have. This lets us remove the local var plus the label. --- libs/gst/base/gstaggregator.c | 22 ++++------------------ 1 file changed, 4 insertions(+), 18 deletions(-) diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c index 2bad1a1..289268a 100644 --- a/libs/gst/base/gstaggregator.c +++ b/libs/gst/base/gstaggregator.c @@ -2034,28 +2034,17 @@ static gboolean gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event) { EventData evdata; - gboolean res = TRUE; switch (GST_EVENT_TYPE (event)) { case GST_EVENT_SEEK: - { - gst_event_ref (event); - res = gst_aggregator_do_seek (self, event); - gst_event_unref (event); - event = NULL; - goto done; - } + /* _do_seek() unrefs the event. */ + return gst_aggregator_do_seek (self, event); case GST_EVENT_NAVIGATION: - { /* navigation is rather pointless. */ - res = FALSE; gst_event_unref (event); - goto done; - } + return FALSE; default: - { break; - } } /* Don't forward QOS events to pads that had no active buffer yet. Otherwise @@ -2064,10 +2053,7 @@ gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event) evdata = gst_aggregator_forward_event_to_all_sinkpads (self, event, FALSE, GST_EVENT_TYPE (event) == GST_EVENT_QOS); - res = evdata.result; - -done: - return res; + return evdata.result; } static gboolean -- 2.7.4