diff --git a/mac/sound.cpp b/mac/sound.cpp index 049ac213..3392c00d 100755 --- a/mac/sound.cpp +++ b/mac/sound.cpp @@ -161,6 +161,12 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector& psData, void* ar lCurDev = INVALID_SNC_CARD_DEVICE; CurrentAudioInputDeviceID = 0; CurrentAudioOutputDeviceID = 0; + iNumInChan = 0; + iNumOutChan = 0; + iSelInputLeftChannel = 0; + iSelInputRightChannel = 0; + iSelOutputLeftChannel = 0; + iSelOutputRightChannel = 0; } void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID, diff --git a/src/clientsettingsdlg.cpp b/src/clientsettingsdlg.cpp index e940d37a..c5fa6d4f 100755 --- a/src/clientsettingsdlg.cpp +++ b/src/clientsettingsdlg.cpp @@ -542,8 +542,11 @@ void CClientSettingsDlg::UpdateSoundChannelSelectionFrame() cbxLInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) ); cbxRInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) ); } - cbxLInChan->setCurrentIndex ( pClient->GetSndCrdLeftInputChannel() ); - cbxRInChan->setCurrentIndex ( pClient->GetSndCrdRightInputChannel() ); + if ( pClient->GetSndCrdNumInputChannels() > 0 ) + { + cbxLInChan->setCurrentIndex ( pClient->GetSndCrdLeftInputChannel() ); + cbxRInChan->setCurrentIndex ( pClient->GetSndCrdRightInputChannel() ); + } // output cbxLOutChan->clear(); @@ -553,8 +556,11 @@ void CClientSettingsDlg::UpdateSoundChannelSelectionFrame() cbxLOutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) ); cbxROutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) ); } - cbxLOutChan->setCurrentIndex ( pClient->GetSndCrdLeftOutputChannel() ); - cbxROutChan->setCurrentIndex ( pClient->GetSndCrdRightOutputChannel() ); + if ( pClient->GetSndCrdNumOutputChannels() > 0 ) + { + cbxLOutChan->setCurrentIndex ( pClient->GetSndCrdLeftOutputChannel() ); + cbxROutChan->setCurrentIndex ( pClient->GetSndCrdRightOutputChannel() ); + } } #else // for other OS, no sound card channel selection is supported