From 42b22187c89a0032b4aff1722ef01f3aaedffcec Mon Sep 17 00:00:00 2001 From: Yue Wang Date: Fri, 25 Jan 2019 19:50:27 -0800 Subject: [PATCH] [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). --- src/output/plugins/OSXOutputPlugin.cxx | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/src/output/plugins/OSXOutputPlugin.cxx b/src/output/plugins/OSXOutputPlugin.cxx index b39d21a35..db7a98e28 100644 --- a/src/output/plugins/OSXOutputPlugin.cxx +++ b/src/output/plugins/OSXOutputPlugin.cxx @@ -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,