aggregator: Always handle serialized events/queries directly before waiting
authorSebastian Dröge <sebastian@centricular.com>
Mon, 19 Aug 2019 15:19:50 +0000 (18:19 +0300)
committerSebastian Dröge <sebastian@centricular.com>
Mon, 19 Aug 2019 15:55:07 +0000 (18:55 +0300)
commit74797e962feb8ec9c3875c3766d107886d2a1b47
treecaf9fd1775d349cb2e907bf7873556dac2bbfe56
parentd90d771a9a512381315f7694c3a50b152035f3cb
aggregator: Always handle serialized events/queries directly before waiting

Otherwise it can happen that we start waiting for another pad, while one
pad already has events that can be handled and potentially also a buffer
that can be handled. That buffer would then however not be accessible by
the subclass from GstAggregator::get_next_time() as there would be the
events in front of it, which doesn't allow the subclass then to
calculate the next time based on already available buffers.

As a side-effect this also allows removing the duplicated event handling
code in the aggregate function as we'll always report pads as not ready
when there is a serialized event or query at the top of at least one
pad's queue.

Fixes https://gitlab.freedesktop.org/gstreamer/gstreamer/issues/428
libs/gst/base/gstaggregator.c