Sound (macOS): ignore input devices

This commit is contained in:
李通洲
2023-10-07 15:43:13 +08:00
parent 41551ef200
commit 3077f885d8
2 changed files with 9 additions and 0 deletions
+1
View File
@@ -7,6 +7,7 @@ Bugfixes:
* Fix possible crashes on Windows 7 (Disk, Windows)
* Fix possible crashes caused by uninitialized strings (Users, Windows)
* Improve support of `--help *-format` and several bugs are found and fixed
* Don't incorrectly print `No active sound devices found` when using a non-controllable sound device (Sound, macOS)
# 2.1.0
+8
View File
@@ -41,6 +41,14 @@ const char* ffDetectSound(FFlist* devices /* List of FFSoundDevice */)
}, 0, NULL, &dataSize, &name) != kAudioHardwareNoError)
continue;
// Ignore input devices
if(AudioObjectGetPropertyDataSize(deviceId, &(AudioObjectPropertyAddress){
kAudioDevicePropertyStreams,
kAudioObjectPropertyScopeInput,
kAudioObjectPropertyElementMain
}, 0, NULL, &dataSize) == kAudioHardwareNoError && dataSize > 0)
continue;
uint32_t connected;
dataSize = sizeof(connected);
if(AudioObjectGetPropertyData(deviceId, &(AudioObjectPropertyAddress){