videoaggregator: Pop out old buffers on timeout
authorEdward Hervey <edward@centricular.com>
Wed, 30 Dec 2020 13:56:54 +0000 (14:56 +0100)
committerEdward Hervey <bilboed@bilboed.com>
Wed, 30 Dec 2020 15:03:13 +0000 (16:03 +0100)
commit65b6994df6ed222ea23cbf68cf7ffc7523e4ed0c
tree0bbdccfe26491681c23611a1f64e2adf6023edcf
parente0a4d3ac4e1467073bd7e13755831888d219d246
videoaggregator: Pop out old buffers on timeout

This situation happens in the situation where an input stream has a framerate
exceeding the timeout latency (Ex: 1fps with a latency of 500ms) and an input
stream greater than output framerate (ex: 60fps in, 30 fps out).

The problem that would happen is that we would timeout, but then buffers from
the fast input stream would only be popped out one by one.... until a buffer
reaches the low-framerate input stream at which point they would quickly be
popped out/used. The resulting output would be "slow ... fast ... slow ... fast"
of that input fast stream.

In order to avoid this situation, whenever we detect a late buffer, check if
there's a next one and re-check with that one.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gst-plugins-base/-/merge_requests/990>
gst-libs/gst/video/gstvideoaggregator.c