possible fix for a crash on MacOS High Sierra (reported in the Jamulus forum)

This commit is contained in:
Volker Fischer 2018-03-08 20:03:07 +00:00
parent cfb4887beb
commit a75670944a
2 changed files with 16 additions and 4 deletions

View File

@ -161,6 +161,12 @@ CSound::CSound ( void (*fpNewProcessCallback) ( CVector<short>& psData, void* ar
lCurDev = INVALID_SNC_CARD_DEVICE; lCurDev = INVALID_SNC_CARD_DEVICE;
CurrentAudioInputDeviceID = 0; CurrentAudioInputDeviceID = 0;
CurrentAudioOutputDeviceID = 0; CurrentAudioOutputDeviceID = 0;
iNumInChan = 0;
iNumOutChan = 0;
iSelInputLeftChannel = 0;
iSelInputRightChannel = 0;
iSelOutputLeftChannel = 0;
iSelOutputRightChannel = 0;
} }
void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID, void CSound::GetAudioDeviceInfos ( const AudioDeviceID DeviceID,

View File

@ -542,8 +542,11 @@ void CClientSettingsDlg::UpdateSoundChannelSelectionFrame()
cbxLInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) ); cbxLInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) );
cbxRInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) ); cbxRInChan->addItem ( pClient->GetSndCrdInputChannelName ( iSndChanIdx ) );
} }
cbxLInChan->setCurrentIndex ( pClient->GetSndCrdLeftInputChannel() ); if ( pClient->GetSndCrdNumInputChannels() > 0 )
cbxRInChan->setCurrentIndex ( pClient->GetSndCrdRightInputChannel() ); {
cbxLInChan->setCurrentIndex ( pClient->GetSndCrdLeftInputChannel() );
cbxRInChan->setCurrentIndex ( pClient->GetSndCrdRightInputChannel() );
}
// output // output
cbxLOutChan->clear(); cbxLOutChan->clear();
@ -553,8 +556,11 @@ void CClientSettingsDlg::UpdateSoundChannelSelectionFrame()
cbxLOutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) ); cbxLOutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) );
cbxROutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) ); cbxROutChan->addItem ( pClient->GetSndCrdOutputChannelName ( iSndChanIdx ) );
} }
cbxLOutChan->setCurrentIndex ( pClient->GetSndCrdLeftOutputChannel() ); if ( pClient->GetSndCrdNumOutputChannels() > 0 )
cbxROutChan->setCurrentIndex ( pClient->GetSndCrdRightOutputChannel() ); {
cbxLOutChan->setCurrentIndex ( pClient->GetSndCrdLeftOutputChannel() );
cbxROutChan->setCurrentIndex ( pClient->GetSndCrdRightOutputChannel() );
}
} }
#else #else
// for other OS, no sound card channel selection is supported // for other OS, no sound card channel selection is supported