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
+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){