Skip to content

Commit

Permalink
Use 'kAudioObjectPropertyElementMaster' instead of 'kAudioObjectPrope…
Browse files Browse the repository at this point in the history
…rtyElementMain' when compiling with MacOS SDKs < v12.0. The build was failing when using older SDKs because 'kAudioObjectPropertyElementMain' was not defined until Apple renamed 'kAudioObjectPropertyElementMaster' in the v12.0 SDK.
  • Loading branch information
Todd Cope authored and SiegeLord committed Aug 11, 2024
1 parent f38ca9f commit 7485248
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions addons/audio/aqueue.m
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,11 @@ static void _aqueue_list_audio_output_devices(void)

propertyAddress.mSelector = kAudioHardwarePropertyDevices;
propertyAddress.mScope = kAudioObjectPropertyScopeGlobal;
propertyAddress.mElement = kAudioObjectPropertyElementMain;
#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 120000)
propertyAddress.mElement = kAudioObjectPropertyElementMain;
#else
propertyAddress.mElement = kAudioObjectPropertyElementMaster;
#endif

if (AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &propertySize) != noErr) {
return;
Expand All @@ -203,7 +207,11 @@ static void _aqueue_list_audio_output_devices(void)
propertySize = sizeof(deviceName);
deviceAddress.mSelector = kAudioDevicePropertyDeviceName;
deviceAddress.mScope = kAudioObjectPropertyScopeGlobal;
deviceAddress.mElement = kAudioObjectPropertyElementMain;
#if (__MAC_OS_X_VERSION_MAX_ALLOWED >= 120000)
deviceAddress.mElement = kAudioObjectPropertyElementMain;
#else
deviceAddress.mElement = kAudioObjectPropertyElementMaster;
#endif
if (AudioObjectGetPropertyData(deviceIDs[idx], &deviceAddress, 0, NULL, &propertySize, deviceName) != noErr) {
continue;
}
Expand Down

0 comments on commit 7485248

Please sign in to comment.