mirror of
https://github.com/outbackdingo/UltraGrid.git
synced 2026-04-07 19:05:47 +00:00
macOS: fixed some other deprecates
This commit is contained in:
@@ -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));
|
||||
|
||||
@@ -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;
|
||||
|
||||
@@ -52,5 +52,10 @@ const char *get_ca_error_str(OSStatus err);
|
||||
}
|
||||
#endif
|
||||
|
||||
#include <Availability.h>
|
||||
#ifndef __MAC_12_0
|
||||
#define kAudioObjectPropertyElementMain kAudioObjectPropertyElementMaster
|
||||
#endif
|
||||
|
||||
/* vim: set expandtab sw=8: */
|
||||
|
||||
|
||||
Reference in New Issue
Block a user