Honor 'device "system"' setting for OSX output

This commit is contained in:
Christian Kröner 2018-03-06 23:08:46 +01:00
parent a3d1b107f4
commit d3f097c7f1
1 changed files with 17 additions and 7 deletions

View File

@ -138,15 +138,25 @@ AudioOutput *
OSXOutput::Create(EventLoop &, const ConfigBlock &block)
{
OSXOutput *oo = new OSXOutput(block);
AudioObjectPropertyAddress aopa;
AudioDeviceID dev_id = kAudioDeviceUnknown;
UInt32 dev_id_size = sizeof(dev_id);
AudioObjectPropertyAddress aopa = {
if (oo->component_subtype == kAudioUnitSubType_SystemOutput)
// get system output dev_id if configured
aopa = {
kAudioHardwarePropertyDefaultSystemOutputDevice,
kAudioObjectPropertyScopeOutput,
kAudioObjectPropertyElementMaster
};
else
// fallback to default device initially (can still be changed by osx_output_set_device)
aopa = {
kAudioHardwarePropertyDefaultOutputDevice,
kAudioObjectPropertyScopeOutput,
kAudioObjectPropertyElementMaster
};
AudioDeviceID dev_id = kAudioDeviceUnknown;
UInt32 dev_id_size = sizeof(dev_id);
AudioObjectGetPropertyData(kAudioObjectSystemObject,
&aopa,
0,