Hector Martin 31a9dc384d libobs: guard against lagging audio sources
df4eb82 fixed a bug that caused source audio timestamps to perpetually
lag. However, there is a deeper issue where after we reach max
buffering, lagging sources make OBS's entire audio pipeline fall over.
These may be corrected by later code, but still cause global audio
glitches at best. Persistent problems, as prior to df4eb82, cause audio
to fail entirely.

The root cause is that OBS's audio mixing tree cannot deal with
timestamps prior to the current audio tick. Intermediate mixing stages
assume that the lowest incoming timestamp is the base of the current
tick, and mix accordingly. This propagates lagged timestamps up the
tree, where at the top level mix_audio will drop the source entirely -
which at this point is a transition covering all inputs, thus glitching
audio globally. Where extra buffering can cover the slip, the entire mix
gets retried and the error corrected, but when the global buffer
duration is maxed out, it makes it to the output.

The solution is to catch laggy sources immediately after rendering, and
drop audio to bring them back in sync, or mark them pending if not
enough audio is available. This ensures later mixing stages are not fed
with out of sync timestamps.

This improves the ignore_audio code to only drop as much audio as
needed to bring the source back in sync, and moves its call to
immediately after source audio rendering.
2021-02-02 13:28:54 -08:00
..
2019-06-23 23:49:10 -07:00
2021-01-30 00:24:16 -08:00
2019-06-23 23:49:10 -07:00
2019-06-23 23:49:10 -07:00
2021-01-08 15:43:39 -08:00
2019-06-23 23:49:10 -07:00
2019-06-23 23:49:10 -07:00
2019-06-23 23:49:10 -07:00
2019-06-23 23:49:10 -07:00
2020-11-14 11:55:22 -08:00
2021-01-28 23:59:02 -08:00
2021-01-28 23:59:02 -08:00
2019-10-14 17:19:38 -07:00
2019-06-23 23:49:10 -07:00
2020-08-10 12:24:01 -07:00
2021-01-02 04:07:55 -08:00