diff --git a/src/async/audio/AsyncAudioDevice.h b/src/async/audio/AsyncAudioDevice.h index fddd601e..854451fd 100644 --- a/src/async/audio/AsyncAudioDevice.h +++ b/src/async/audio/AsyncAudioDevice.h @@ -227,7 +227,8 @@ class AudioDevice : public sigc::trackable AudioDevice::channels = channels; } - + static int getChannels(void) { return channels; } + /** * @brief Check if the audio device has full duplex capability * @return Returns \em true if the device has full duplex capability diff --git a/src/async/audio/AsyncAudioIO.cpp b/src/async/audio/AsyncAudioIO.cpp index c76af70d..215ed955 100644 --- a/src/async/audio/AsyncAudioIO.cpp +++ b/src/async/audio/AsyncAudioIO.cpp @@ -318,6 +318,16 @@ bool AudioIO::isFullDuplexCapable(void) bool AudioIO::open(Mode mode) { + if (m_channel >= AudioDevice::getChannels()) + { + std::cerr << "*** ERROR: Audio channel out of range when opening audio " + "device \"" << audio_dev->devName() << ". " + << "The card have " << AudioDevice::getChannels() + << " channel(s) configured, but (zero based) channel number " + << m_channel << " was requested." << std::endl; + return false; + } + if (audio_dev == 0) { return false; diff --git a/src/versions b/src/versions index b846ba83..548b720c 100644 --- a/src/versions +++ b/src/versions @@ -8,7 +8,7 @@ QTEL=1.2.4 LIBECHOLIB=1.3.3 # Version for the Async library -LIBASYNC=1.6.0.99.9 +LIBASYNC=1.6.0.99.10 # SvxLink versions SVXLINK=1.7.99.23