0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 21:13:04 +02:00
obs-studio/libobs
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
..
audio-monitoring linux-pulseaudio: fix race conditions 2020-12-12 12:05:12 -08:00
callback clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
data libobs: Fix Area shaders missing for RGB output 2019-08-31 00:25:24 -07:00
graphics libobs: gs_duplicator_get_monitor_index 2021-01-26 17:11:04 -08:00
media-io libobs, obs-ffmpeg: Use correct value for EINVAL error check 2020-12-21 18:37:49 +01:00
util libobs: Avoid strncpy warning 2021-01-30 00:24:16 -08:00
CMakeLists.txt Merge pull request #2233 from VodBox/missing-files-dialog 2021-01-31 08:02:16 -08:00
libobs.pc.in libobs: add ppc64(le) specific flags to libobs.pc 2020-04-27 00:07:18 +02:00
LibObsConfig.cmake.in cmake: Export plugin data destination 2014-09-27 09:41:32 -07:00
LibObsConfigVersion.cmake.in Export libobs cmake target, so external plugins can be built without ugly hacks 2014-05-08 14:43:16 +02:00
obs-audio-controls.c libobs: fix building modules once installed 2019-11-27 14:00:15 -05:00
obs-audio-controls.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-audio.c libobs: guard against lagging audio sources 2021-02-02 13:28:54 -08:00
obs-avc.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-avc.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-cocoa.m libobs: Cleanup uses of objc_msgSend in Objective-C code 2021-01-12 10:10:37 -08:00
obs-config.h libobs: Update version to 26.1.2 2021-01-08 15:43:39 -08:00
obs-data.c libobs: Return default obj and array rather than current 2020-10-23 22:32:20 -07:00
obs-data.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-defs.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-display.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-encoder.c Merge pull request #2657 from hselasky/improvement 2020-05-21 18:07:53 -07:00
obs-encoder.h UI: Hide encoder if marked internal 2020-02-18 21:37:41 -08:00
obs-ffmpeg-compat.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-hotkey-name-map.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-hotkey.c libobs, linux-v4l2: Set thread names 2021-01-25 04:13:24 -08:00
obs-hotkey.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-hotkeys.h libobs: Remove _WIN32 ifdef from enum 2019-11-17 20:30:42 -08:00
obs-interaction.h clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-internal.h decklink: Add ability to ingest/embed cea 708 captions 2020-11-01 22:28:49 -08:00
obs-missing-files.c libobs: Add missing file API to sources 2021-01-17 10:31:58 +13:00
obs-missing-files.h libobs: Add missing file API to sources 2021-01-17 10:31:58 +13:00
obs-module.c libobs: Add function to get module lib 2021-01-26 03:31:31 -08:00
obs-module.h libobs: Add functions to get locale text from modules 2020-08-10 12:24:01 -07:00
obs-nix.c Add OpenBSD support 2020-11-14 11:55:22 -08:00
obs-output-delay.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-output.c libobs: Fix bad type and size mismatch 2020-11-04 04:45:07 -08:00
obs-output.h libobs: Implement pausing of outputs 2019-07-07 16:38:22 -07:00
obs-properties.c libobs: Support color picker with alpha 2021-01-11 11:52:50 -08:00
obs-properties.h libobs: Support color picker with alpha 2021-01-11 11:52:50 -08:00
obs-scene.c libobs: Fix leaking obs-internal.h 2021-01-28 23:59:02 -08:00
obs-scene.h libobs: Fix leaking obs-internal.h 2021-01-28 23:59:02 -08:00
obs-service.c libobs: Change service max res. to res. list 2020-11-13 18:22:53 -08:00
obs-service.h libobs: Change service max res. to res. list 2020-11-13 18:22:53 -08:00
obs-source-deinterlace.c libobs: Deinterlace as linear SRGB when needed 2021-01-21 07:42:57 -08:00
obs-source-transition.c libobs: transition: ignore sources with ts=0 2021-02-02 13:28:54 -08:00
obs-source.c Merge pull request #2233 from VodBox/missing-files-dialog 2021-01-31 08:02:16 -08:00
obs-source.h libobs: Add missing file API to sources 2021-01-17 10:31:58 +13:00
obs-ui.h docs/sphinx: Fix various typos 2019-10-14 17:19:38 -07:00
obs-video-gpu-encode.c libobs: Fix race condition 2019-11-05 12:02:54 -08:00
obs-video.c libobs: Final downsample with SRGB formats 2021-01-21 07:42:57 -08:00
obs-view.c clang-format: Apply formatting 2019-06-23 23:49:10 -07:00
obs-win-crash-handler.c libobs: Add Windows 10 release version to crash log 2020-04-29 20:38:21 -04:00
obs-windows.c libobs: Log Windows 10 Hardware GPU Scheduler 2020-08-26 22:57:52 +02:00
obs.c Merge pull request #3014 from notr1ch/remove-excessive-null-checks 2020-06-21 04:56:45 -07:00
obs.h Merge pull request #2233 from VodBox/missing-files-dialog 2021-01-31 08:02:16 -08:00
obs.hpp libobs: Add OBSRef::Get() 2020-08-10 12:24:01 -07:00
obsconfig.h.in libobs: Update to SIMDe 0.7.1 2021-01-02 04:07:55 -08:00