summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStefan Sauer <ensonic@users.sf.net>2017-10-15 17:46:45 +0200
committerTim-Philipp Müller <tim@centricular.com>2017-12-02 15:10:27 +0000
commit8776900cf7359054e0ae03819e3d01e270f62bcf (patch)
tree6f655845718995a10c3bfd1ef559e1d1c238f1e6
parent5509920c27ad8ff3253329c5657e9e58bdaf20dc (diff)
aggregator: simplify pad_event_func for FLUSH_STOP events
We want to skip serialization for FLUSH_STOP events (apparently). We can simplify the code to add it to the top-level conditions. There was nothing done in the first code path if the event was FLUSH_STOP.
-rw-r--r--libs/gst/base/gstaggregator.c20
1 files changed, 7 insertions, 13 deletions
diff --git a/libs/gst/base/gstaggregator.c b/libs/gst/base/gstaggregator.c
index a3018cd06..538c7e975 100644
--- a/libs/gst/base/gstaggregator.c
+++ b/libs/gst/base/gstaggregator.c
@@ -2663,12 +2663,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (parent);
- if (GST_EVENT_IS_SERIALIZED (event)) {
+ if (GST_EVENT_IS_SERIALIZED (event)
+ && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) {
SRC_LOCK (self);
PAD_LOCK (aggpad);
- if (aggpad->priv->flow_return != GST_FLOW_OK
- && GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) {
+ if (aggpad->priv->flow_return != GST_FLOW_OK) {
ret = aggpad->priv->flow_return;
goto flushing;
}
@@ -2681,18 +2681,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
GST_OBJECT_UNLOCK (aggpad);
}
- if (GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) {
- GST_DEBUG_OBJECT (aggpad, "Store event in queue: %" GST_PTR_FORMAT,
- event);
- g_queue_push_head (&aggpad->priv->data, event);
- event = NULL;
- SRC_BROADCAST (self);
- }
+ GST_DEBUG_OBJECT (aggpad, "Store event in queue: %" GST_PTR_FORMAT, event);
+ g_queue_push_head (&aggpad->priv->data, event);
+ SRC_BROADCAST (self);
PAD_UNLOCK (aggpad);
SRC_UNLOCK (self);
- }
-
- if (event) {
+ } else {
if (!klass->sink_event (self, aggpad, event)) {
/* Copied from GstPad to convert boolean to a GstFlowReturn in
* the event handling func */