From 002696e795fdc54c1dcf726e64b24da53987d905 Mon Sep 17 00:00:00 2001 From: Luke Yelavich Date: Wed, 27 Jun 2018 12:07:57 +1000 Subject: [PATCH] libobs: Rework checking Mac audio device capabilities As of commit 2eb5a22, CoreAudio devices that use one device handle for both input and output can no longer be used for audio monitoring. This commit fixes that. Tested with the built-in output, a Magewell XI100DUSB-HDMI which is input only, and a MOTU UltraLite audio interface, which shows as output/input capable. --- libobs/audio-monitoring/osx/coreaudio-enum-devices.c | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/libobs/audio-monitoring/osx/coreaudio-enum-devices.c b/libobs/audio-monitoring/osx/coreaudio-enum-devices.c index 22842ed88..9f06cb6eb 100644 --- a/libobs/audio-monitoring/osx/coreaudio-enum-devices.c +++ b/libobs/audio-monitoring/osx/coreaudio-enum-devices.c @@ -25,16 +25,14 @@ static bool obs_enum_audio_monitoring_device(obs_enum_audio_device_cb cb, AudioObjectPropertyAddress addr = { kAudioDevicePropertyStreams, - kAudioDevicePropertyScopeInput, + kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; - /* check to see if it's a mac input device */ - if (!allow_inputs) { - AudioObjectGetPropertyDataSize(id, &addr, 0, NULL, &size); - if (size) - return true; - } + /* Check if the device is capable of audio output. */ + AudioObjectGetPropertyDataSize(id, &addr, 0, NULL, &size); + if (!allow_inputs && !size) + return true; size = sizeof(CFStringRef);