diff options
author | Roxie Linden <roxie@lindenlab.com> | 2023-09-22 10:47:48 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-02-22 23:11:34 -0800 |
commit | c087b8648dc85cffdc4d9a5eb85d989a9b4aa51b (patch) | |
tree | b629d5dbf1b0a3a145330f4179c853f4035578b4 /indra/newview/llvoicewebrtc.cpp | |
parent | 4624184f97a94cd99df3640f5fc1e596c30bbffe (diff) |
Fix shutdown crash issue.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index b621f5ee92..e6877063b5 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2100,7 +2100,7 @@ void LLWebRTCVoiceClient::tuningSetSpeakerVolume(float volume) float LLWebRTCVoiceClient::tuningGetEnergy(void) { - return mWebRTCDeviceInterface->getTuningMicrophoneEnergy(); + return mWebRTCDeviceInterface->getAudioLevel(); } bool LLWebRTCVoiceClient::deviceSettingsAvailable() @@ -2357,9 +2357,14 @@ void LLWebRTCVoiceClient::sendPositionAndVolumeUpdate(void) } } - if (mWebRTCAudioInterface) + if (mWebRTCDataInterface && mWebRTCAudioInterface) { - mWebRTCAudioInterface->requestAudioLevel(); + Json::FastWriter writer; + Json::Value root; + root["p"] = (uint32_t) ((F32)mWebRTCDeviceInterface->getAudioLevel() * 256); + std::string json_data = writer.write(root); + + mWebRTCDataInterface->sendData(json_data, false); } @@ -2613,19 +2618,6 @@ void LLWebRTCVoiceClient::OnAudioEstablished(llwebrtc::LLWebRTCAudioInterface * setVoiceControlStateUnless(VOICE_STATE_SESSION_ESTABLISHED, VOICE_STATE_SESSION_RETRY); } -void LLWebRTCVoiceClient::OnAudioLevel(float level) -{ - if (mWebRTCDataInterface) - { - Json::FastWriter writer; - Json::Value root; - root["p"] = (uint32_t) (level * 256); - std::string json_data = writer.write(root); - - mWebRTCDataInterface->sendData(json_data, false); - } -} - void LLWebRTCVoiceClient::OnDataReceived(const std::string& data, bool binary) { // incoming data will be a json structure (if it's not binary.) We may pack |