Skip to content

Commit 3077f88

Browse files
committed
Sound (macOS): ignore input devices
1 parent 41551ef commit 3077f88

File tree

2 files changed

+9
-0
lines changed

2 files changed

+9
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ Bugfixes:
77
* Fix possible crashes on Windows 7 (Disk, Windows)
88
* Fix possible crashes caused by uninitialized strings (Users, Windows)
99
* Improve support of `--help *-format` and several bugs are found and fixed
10+
* Don't incorrectly print `No active sound devices found` when using a non-controllable sound device (Sound, macOS)
1011

1112
# 2.1.0
1213

src/detection/sound/sound_apple.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -41,6 +41,14 @@ const char* ffDetectSound(FFlist* devices /* List of FFSoundDevice */)
4141
}, 0, NULL, &dataSize, &name) != kAudioHardwareNoError)
4242
continue;
4343

44+
// Ignore input devices
45+
if(AudioObjectGetPropertyDataSize(deviceId, &(AudioObjectPropertyAddress){
46+
kAudioDevicePropertyStreams,
47+
kAudioObjectPropertyScopeInput,
48+
kAudioObjectPropertyElementMain
49+
}, 0, NULL, &dataSize) == kAudioHardwareNoError && dataSize > 0)
50+
continue;
51+
4452
uint32_t connected;
4553
dataSize = sizeof(connected);
4654
if(AudioObjectGetPropertyData(deviceId, &(AudioObjectPropertyAddress){

0 commit comments

Comments
 (0)