#4871 Fix webrtc crash on tuningGetEnergy
parent
528c4b5f31
commit
9a2ff1657d
|
|
@ -396,7 +396,7 @@ void LLWebRTCVoiceClient::updateSettings()
|
||||||
config.mNoiseSuppressionLevel = noiseSuppressionLevel;
|
config.mNoiseSuppressionLevel = noiseSuppressionLevel;
|
||||||
audioConfigChanged = true;
|
audioConfigChanged = true;
|
||||||
}
|
}
|
||||||
if (audioConfigChanged)
|
if (audioConfigChanged && mWebRTCDeviceInterface)
|
||||||
{
|
{
|
||||||
mWebRTCDeviceInterface->setAudioConfig(config);
|
mWebRTCDeviceInterface->setAudioConfig(config);
|
||||||
}
|
}
|
||||||
|
|
@ -797,7 +797,10 @@ void LLWebRTCVoiceClient::tuningStart()
|
||||||
{
|
{
|
||||||
if (!mIsInTuningMode)
|
if (!mIsInTuningMode)
|
||||||
{
|
{
|
||||||
mWebRTCDeviceInterface->setTuningMode(true);
|
if (mWebRTCDeviceInterface)
|
||||||
|
{
|
||||||
|
mWebRTCDeviceInterface->setTuningMode(true);
|
||||||
|
}
|
||||||
mIsInTuningMode = true;
|
mIsInTuningMode = true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -806,7 +809,10 @@ void LLWebRTCVoiceClient::tuningStop()
|
||||||
{
|
{
|
||||||
if (mIsInTuningMode)
|
if (mIsInTuningMode)
|
||||||
{
|
{
|
||||||
mWebRTCDeviceInterface->setTuningMode(false);
|
if (mWebRTCDeviceInterface)
|
||||||
|
{
|
||||||
|
mWebRTCDeviceInterface->setTuningMode(false);
|
||||||
|
}
|
||||||
mIsInTuningMode = false;
|
mIsInTuningMode = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -839,6 +845,10 @@ void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume)
|
||||||
|
|
||||||
float LLWebRTCVoiceClient::tuningGetEnergy(void)
|
float LLWebRTCVoiceClient::tuningGetEnergy(void)
|
||||||
{
|
{
|
||||||
|
if (!mWebRTCDeviceInterface)
|
||||||
|
{
|
||||||
|
return 0.f;
|
||||||
|
}
|
||||||
float rms = mWebRTCDeviceInterface->getTuningAudioLevel();
|
float rms = mWebRTCDeviceInterface->getTuningAudioLevel();
|
||||||
return TUNING_LEVEL_START_POINT - TUNING_LEVEL_SCALE * rms;
|
return TUNING_LEVEL_START_POINT - TUNING_LEVEL_SCALE * rms;
|
||||||
}
|
}
|
||||||
|
|
@ -866,7 +876,10 @@ void LLWebRTCVoiceClient::refreshDeviceLists(bool clearCurrentList)
|
||||||
clearCaptureDevices();
|
clearCaptureDevices();
|
||||||
clearRenderDevices();
|
clearRenderDevices();
|
||||||
}
|
}
|
||||||
mWebRTCDeviceInterface->refreshDevices();
|
if (mWebRTCDeviceInterface)
|
||||||
|
{
|
||||||
|
mWebRTCDeviceInterface->refreshDevices();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
@ -1174,7 +1187,7 @@ void LLWebRTCVoiceClient::sendPositionUpdate(bool force)
|
||||||
void LLWebRTCVoiceClient::updateOwnVolume()
|
void LLWebRTCVoiceClient::updateOwnVolume()
|
||||||
{
|
{
|
||||||
F32 audio_level = 0.0f;
|
F32 audio_level = 0.0f;
|
||||||
if (!mMuteMic)
|
if (!mMuteMic && mWebRTCDeviceInterface)
|
||||||
{
|
{
|
||||||
float rms = mWebRTCDeviceInterface->getPeerConnectionAudioLevel();
|
float rms = mWebRTCDeviceInterface->getPeerConnectionAudioLevel();
|
||||||
audio_level = LEVEL_START_POINT - LEVEL_SCALE * rms;
|
audio_level = LEVEL_START_POINT - LEVEL_SCALE * rms;
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue