From aa713fcd833a037290e92ba59500354cba7f6cbb Mon Sep 17 00:00:00 2001 From: Tim Mayberry Date: Sun, 27 Sep 2015 08:53:19 +1000 Subject: [PATCH] Return meaningful error codes when PortaudioBackend fails to start So they can be used to give a contextual error message in the GUI --- libs/backends/portaudio/portaudio_backend.cc | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/libs/backends/portaudio/portaudio_backend.cc b/libs/backends/portaudio/portaudio_backend.cc index b1c83349ae..3c8a238d71 100644 --- a/libs/backends/portaudio/portaudio_backend.cc +++ b/libs/backends/portaudio/portaudio_backend.cc @@ -480,8 +480,14 @@ PortAudioBackend::_start (bool for_latency_measurement) switch (err) { case paNoError: break; + case paBadIODeviceCombination: + return DeviceConfigurationNotSupportedError; + case paInvalidChannelCount: + return ChannelCountNotSupportedError; + case paInvalidSampleRate: + return SampleRateNotSupportedError; default: - return -1; + return AudioDeviceOpenError; } if (_n_outputs != _pcmio->n_playback_channels ()) {