Commit cd5a89ae authored by David Fuhrmann's avatar David Fuhrmann

auhal: do not check if device 0 is alive

It will fail in any way.
parent a071518a
...@@ -279,23 +279,23 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt) ...@@ -279,23 +279,23 @@ static int Start(audio_output_t *p_aout, audio_sample_format_t *restrict fmt)
msg_Dbg(p_aout, "attempting to use device %i", p_sys->i_selected_dev); msg_Dbg(p_aout, "attempting to use device %i", p_sys->i_selected_dev);
/* Check if the desired device is alive and usable */ AudioObjectPropertyAddress audioDeviceAliveAddress = { kAudioDevicePropertyDeviceIsAlive, kAudioObjectPropertyScopeGlobal, kAudioObjectPropertyElementMaster };
i_param_size = sizeof(b_alive); if (p_sys->i_selected_dev > 0) {
AudioObjectPropertyAddress audioDeviceAliveAddress = { kAudioDevicePropertyDeviceIsAlive, /* Check if the desired device is alive and usable */
kAudioObjectPropertyScopeGlobal, i_param_size = sizeof(b_alive);
kAudioObjectPropertyElementMaster }; err = AudioObjectGetPropertyData(p_sys->i_selected_dev, &audioDeviceAliveAddress, 0, NULL, &i_param_size, &b_alive);
err = AudioObjectGetPropertyData(p_sys->i_selected_dev, &audioDeviceAliveAddress, 0, NULL, &i_param_size, &b_alive); if (err != noErr) {
/* Be tolerant, only give a warning here */
msg_Warn(p_aout, "could not check whether device [0x%x] is alive [%4.4s]",
(unsigned int)p_sys->i_selected_dev, (char *)&err);
b_alive = false;
}
if (err != noErr) { if (!b_alive)
/* Be tolerant, only give a warning here */ msg_Warn(p_aout, "selected audio device is not alive, switching to default device");
msg_Warn(p_aout, "could not check whether device [0x%x] is alive [%4.4s]",
(unsigned int)p_sys->i_selected_dev, (char *)&err);
b_alive = false;
} }
if (!b_alive || p_sys->i_selected_dev == 0) { if (!b_alive || p_sys->i_selected_dev == 0) {
msg_Warn(p_aout, "selected audio device is not alive, switching to default device");
AudioObjectID defaultDeviceID = 0; AudioObjectID defaultDeviceID = 0;
UInt32 propertySize = 0; UInt32 propertySize = 0;
AudioObjectPropertyAddress defaultDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster }; AudioObjectPropertyAddress defaultDeviceAddress = { kAudioHardwarePropertyDefaultOutputDevice, kAudioDevicePropertyScopeOutput, kAudioObjectPropertyElementMaster };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment