mirror of
https://gitlab.freedesktop.org/gstreamer/gstreamer.git
synced 2025-01-18 05:16:05 +00:00
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.
This commit is contained in:
parent
70d0945b35
commit
a82e6bc650
1 changed files with 4 additions and 18 deletions
|
@ -2034,28 +2034,17 @@ static gboolean
|
||||||
gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event)
|
gst_aggregator_default_src_event (GstAggregator * self, GstEvent * event)
|
||||||
{
|
{
|
||||||
EventData evdata;
|
EventData evdata;
|
||||||
gboolean res = TRUE;
|
|
||||||
|
|
||||||
switch (GST_EVENT_TYPE (event)) {
|
switch (GST_EVENT_TYPE (event)) {
|
||||||
case GST_EVENT_SEEK:
|
case GST_EVENT_SEEK:
|
||||||
{
|
/* _do_seek() unrefs the event. */
|
||||||
gst_event_ref (event);
|
return gst_aggregator_do_seek (self, event);
|
||||||
res = gst_aggregator_do_seek (self, event);
|
|
||||||
gst_event_unref (event);
|
|
||||||
event = NULL;
|
|
||||||
goto done;
|
|
||||||
}
|
|
||||||
case GST_EVENT_NAVIGATION:
|
case GST_EVENT_NAVIGATION:
|
||||||
{
|
|
||||||
/* navigation is rather pointless. */
|
/* navigation is rather pointless. */
|
||||||
res = FALSE;
|
|
||||||
gst_event_unref (event);
|
gst_event_unref (event);
|
||||||
goto done;
|
return FALSE;
|
||||||
}
|
|
||||||
default:
|
default:
|
||||||
{
|
|
||||||
break;
|
break;
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Don't forward QOS events to pads that had no active buffer yet. Otherwise
|
/* 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 =
|
evdata =
|
||||||
gst_aggregator_forward_event_to_all_sinkpads (self, event, FALSE,
|
gst_aggregator_forward_event_to_all_sinkpads (self, event, FALSE,
|
||||||
GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
GST_EVENT_TYPE (event) == GST_EVENT_QOS);
|
||||||
res = evdata.result;
|
return evdata.result;
|
||||||
|
|
||||||
done:
|
|
||||||
return res;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static gboolean
|
static gboolean
|
||||||
|
|
Loading…
Reference in a new issue