summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorRoxie Linden <roxie@lindenlab.com>2023-09-22 10:47:48 -0700
committerRoxie Linden <roxie@lindenlab.com>2024-02-08 18:34:01 -0800
commitcf72241f97627c59b5d5ab414caf086bffd47dc1 (patch)
tree55fa98ca7dd3afad0b668d1bd7cd57969247b5c8 /indra/newview
parent64ec3cb19ffeeb25d7d235e60629c9b4890986f1 (diff)
Fix shutdown crash issue.
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoicewebrtc.cpp24
-rw-r--r--indra/newview/llvoicewebrtc.h1
2 files changed, 8 insertions, 17 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
diff --git a/indra/newview/llvoicewebrtc.h b/indra/newview/llvoicewebrtc.h
index bc858dcb32..518fee53ef 100644
--- a/indra/newview/llvoicewebrtc.h
+++ b/indra/newview/llvoicewebrtc.h
@@ -263,7 +263,6 @@ public:
/// @name Signaling notification
// LLWebRTCAudioObserver
//@{
- void OnAudioLevel(float level) override;
//@}
/////////////////////////