diff --git a/src/audio/capture/coreaudio.m b/src/audio/capture/coreaudio.m index 90ae9f40b..1f27b105c 100644 --- a/src/audio/capture/coreaudio.m +++ b/src/audio/capture/coreaudio.m @@ -239,7 +239,7 @@ static void * audio_cap_ca_init(struct module *parent, const char *cfg) AudioObjectPropertyAddress propertyAddress; propertyAddress.mSelector = kAudioHardwarePropertyDefaultInputDevice; propertyAddress.mScope = kAudioObjectPropertyScopeGlobal; - propertyAddress.mElement = kAudioObjectPropertyElementMaster; + propertyAddress.mElement = kAudioObjectPropertyElementMain; if ((ret = AudioObjectGetPropertyData(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size, &device)) != 0) { log_msg(LOG_LEVEL_ERROR, "Error finding default input device: %s.\n", get_ca_error_str(ret)); return NULL; @@ -263,7 +263,7 @@ static void * audio_cap_ca_init(struct module *parent, const char *cfg) AudioObjectPropertyAddress propertyAddress; propertyAddress.mSelector = kAudioDevicePropertyNominalSampleRate; propertyAddress.mScope = kAudioDevicePropertyScopeInput; - propertyAddress.mElement = kAudioObjectPropertyElementMaster; + propertyAddress.mElement = kAudioObjectPropertyElementMain; ret = AudioObjectGetPropertyData(device, &propertyAddress, 0, NULL, &size, &rate); if (ret != noErr || rate == 0.0) { log_msg(LOG_LEVEL_ERROR, MOD_NAME "Unable to get sample rate: %s. Wrong device index?\n", get_ca_error_str(ret)); diff --git a/src/audio/playback/coreaudio.cpp b/src/audio/playback/coreaudio.cpp index 1b3defcc9..b31279af8 100644 --- a/src/audio/playback/coreaudio.cpp +++ b/src/audio/playback/coreaudio.cpp @@ -298,7 +298,7 @@ void audio_ca_probe(struct device_info **available_devices, int *count, int dir) propertyAddress.mSelector = kAudioHardwarePropertyDevices; propertyAddress.mScope = kAudioObjectPropertyScopeGlobal; - propertyAddress.mElement = kAudioObjectPropertyElementMaster; + propertyAddress.mElement = kAudioObjectPropertyElementMain; ret = AudioObjectGetPropertyDataSize(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size); if (ret) { goto error; @@ -429,7 +429,7 @@ static void * audio_play_ca_init(const char *cfg) UInt32 size = sizeof device; propertyAddress.mSelector = kAudioHardwarePropertyDefaultOutputDevice; propertyAddress.mScope = kAudioObjectPropertyScopeGlobal; - propertyAddress.mElement = kAudioObjectPropertyElementMaster; + propertyAddress.mElement = kAudioObjectPropertyElementMain; ret = AudioObjectGetPropertyData(kAudioObjectSystemObject, &propertyAddress, 0, NULL, &size, &device); if(ret) goto error; diff --git a/src/audio/playback/coreaudio.h b/src/audio/playback/coreaudio.h index cb5b8470a..64e5a65d2 100644 --- a/src/audio/playback/coreaudio.h +++ b/src/audio/playback/coreaudio.h @@ -52,5 +52,10 @@ const char *get_ca_error_str(OSStatus err); } #endif +#include +#ifndef __MAC_12_0 +#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster +#endif + /* vim: set expandtab sw=8: */