base: audioencoder: Keep serialize event behind buffers
authorNicolas Dufresne <nicolas.dufresne@collabora.com>
Thu, 28 Oct 2021 21:09:34 +0000 (17:09 -0400)
committerNicolas Dufresne <nicolas.dufresne@collabora.com>
Fri, 18 Feb 2022 19:40:29 +0000 (14:40 -0500)
commit6bd1f2753abf4fe7bec0d6bb193b1569522b4260
tree620734b7ca83b77d92c3a9115a60632186a2d6c1
parente1c0628bb9dff6f120afeb6febc21072226cd708
base: audioencoder: Keep serialize event behind buffers

If a serialized event arrives behind a buffer, it should not be send before
it. This fixes the pending event handling so that only early pending events,
the one that arrrived or was generated while the adapter was empty get send
before pushing buffer. All other events are not pushed after.

This issue lead the latency tracer to think our audio encoder did not have any
latency. This was testing with opusenc in a live pipeline.

Part-of: <https://gitlab.freedesktop.org/gstreamer/gstreamer/-/merge_requests/1266>
subprojects/gst-plugins-base/gst-libs/gst/audio/gstaudioencoder.c