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.
This commit is contained in:
Stefan Sauer 2017-10-15 17:46:45 +02:00 committed by Tim-Philipp Müller
parent 5509920c27
commit 8776900cf7

View file

@ -2663,12 +2663,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad); GstAggregatorPad *aggpad = GST_AGGREGATOR_PAD (pad);
GstAggregatorClass *klass = GST_AGGREGATOR_GET_CLASS (parent); 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); SRC_LOCK (self);
PAD_LOCK (aggpad); PAD_LOCK (aggpad);
if (aggpad->priv->flow_return != GST_FLOW_OK if (aggpad->priv->flow_return != GST_FLOW_OK) {
&& GST_EVENT_TYPE (event) != GST_EVENT_FLUSH_STOP) {
ret = aggpad->priv->flow_return; ret = aggpad->priv->flow_return;
goto flushing; goto flushing;
} }
@ -2681,18 +2681,12 @@ gst_aggregator_pad_event_func (GstPad * pad, GstObject * parent,
GST_OBJECT_UNLOCK (aggpad); 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);
GST_DEBUG_OBJECT (aggpad, "Store event in queue: %" GST_PTR_FORMAT, g_queue_push_head (&aggpad->priv->data, event);
event); SRC_BROADCAST (self);
g_queue_push_head (&aggpad->priv->data, event);
event = NULL;
SRC_BROADCAST (self);
}
PAD_UNLOCK (aggpad); PAD_UNLOCK (aggpad);
SRC_UNLOCK (self); SRC_UNLOCK (self);
} } else {
if (event) {
if (!klass->sink_event (self, aggpad, event)) { if (!klass->sink_event (self, aggpad, event)) {
/* Copied from GstPad to convert boolean to a GstFlowReturn in /* Copied from GstPad to convert boolean to a GstFlowReturn in
* the event handling func */ * the event handling func */