Check channel number when opening audio device
The configured channel number for an audio device is now checked against the value set in CARD_CHANNELS before trying to open the audio device.
This commit is contained in:
parent
be4d911302
commit
b38dff32ec
|
|
@ -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
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue