From ec5f499cb305e88104136bbcb4bd3d523e16faec Mon Sep 17 00:00:00 2001 From: gxalpha Date: Sun, 18 Aug 2024 02:21:15 +0200 Subject: [PATCH] UI: Inline macOS 13 check --- UI/platform-osx.mm | 9 --------- UI/platform.hpp | 1 - UI/window-basic-main.cpp | 6 +++++- 3 files changed, 5 insertions(+), 11 deletions(-) diff --git a/UI/platform-osx.mm b/UI/platform-osx.mm index 07f1d77b8..75f4adfba 100644 --- a/UI/platform-osx.mm +++ b/UI/platform-osx.mm @@ -133,15 +133,6 @@ void SetAlwaysOnTop(QWidget *window, bool enable) window->show(); } -bool shouldCreateDefaultAudioSource(void) -{ - if (@available(macOS 13, *)) { - return false; - } else { - return true; - } -} - bool SetDisplayAffinitySupported(void) { // Not implemented yet diff --git a/UI/platform.hpp b/UI/platform.hpp index 73e15d4af..ecea323c8 100644 --- a/UI/platform.hpp +++ b/UI/platform.hpp @@ -101,7 +101,6 @@ void InstallNSApplicationSubclass(); void InstallNSThreadLocks(); void disableColorSpaceConversion(QWidget *window); void SetMacOSDarkMode(bool dark); -bool shouldCreateDefaultAudioSource(); MacPermissionStatus CheckPermissionWithPrompt(MacPermissionType type, bool prompt_for_permission); diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 91bac6596..0d0b0df80 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -1023,7 +1023,11 @@ void OBSBasic::CreateFirstRunSources() bool hasInputAudio = HasAudioDevices(App()->InputAudioSource()); #ifdef __APPLE__ - hasDesktopAudio = hasDesktopAudio && shouldCreateDefaultAudioSource(); + /* On macOS 13 and above, the SCK based audio capture provides a + * better alternative to the device-based audio capture. */ + if (__builtin_available(macOS 13.0, *)) { + hasDesktopAudio = false; + } #endif if (hasDesktopAudio)