aggregator: drop duplicated SEEK events

This is similar to what demuxers do, and necessary when multiple
sinks get seeked downstream of the aggregator: if we forward
duplicated seeks upstream, elements such as demuxers may drop
the flushing seeks, but return TRUE, aggregator then waits forever
for the flushing events.

Fixes #276
This commit is contained in:
Mathieu Duponchelle 2019-07-19 17:28:25 +02:00
parent 214fe0f230
commit 9ec55072d2

View file

@ -2022,6 +2022,15 @@ gst_aggregator_do_seek (GstAggregator * self, GstEvent * event)
flush = flags & GST_SEEK_FLAG_FLUSH; flush = flags & GST_SEEK_FLAG_FLUSH;
GST_OBJECT_LOCK (self); GST_OBJECT_LOCK (self);
if (gst_event_get_seqnum (event) == self->priv->next_seqnum) {
evdata.result = TRUE;
GST_DEBUG_OBJECT (self, "Dropping duplicated seek event with seqnum %d",
self->priv->next_seqnum);
GST_OBJECT_UNLOCK (self);
goto done;
}
self->priv->next_seqnum = gst_event_get_seqnum (event); self->priv->next_seqnum = gst_event_get_seqnum (event);
gst_segment_do_seek (&GST_AGGREGATOR_PAD (self->srcpad)->segment, rate, fmt, gst_segment_do_seek (&GST_AGGREGATOR_PAD (self->srcpad)->segment, rate, fmt,
@ -2063,6 +2072,7 @@ gst_aggregator_do_seek (GstAggregator * self, GstEvent * event)
} }
} }
done:
GST_INFO_OBJECT (self, "seek done, result: %d", evdata.result); GST_INFO_OBJECT (self, "seek done, result: %d", evdata.result);
return evdata.result; return evdata.result;