[OSXOutput] Throw an error when device not found

Currently it falls back to system default device (either internal speaker or headphone) when device not found. 
I believe it is a better to fail in this case, to make it better aligned with platforms (such as alsa).
This commit is contained in:
Yue Wang 2019-01-25 19:50:27 -08:00 committed by GitHub
parent cfe22502ab
commit 42b22187c8
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 4 deletions

View File

@ -637,11 +637,8 @@ osx_output_set_device(OSXOutput *oo)
}
}
if (i == numdevices) {
FormatWarning(osx_output_domain,
"Found no audio device with name '%s' "
"(will use default audio device)",
throw FormatRuntimeError("Found no audio device with name '%s' ",
oo->device_name);
return;
}
status = AudioUnitSetProperty(oo->au,