summaryrefslogtreecommitdiff
path: root/indra/newview/llvoicewebrtc.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r--indra/newview/llvoicewebrtc.cpp15
1 files changed, 10 insertions, 5 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index e6877063b5..3942f4171d 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -2359,12 +2359,17 @@ void LLWebRTCVoiceClient::sendPositionAndVolumeUpdate(void)
if (mWebRTCDataInterface && mWebRTCAudioInterface)
{
- Json::FastWriter writer;
- Json::Value root;
- root["p"] = (uint32_t) ((F32)mWebRTCDeviceInterface->getAudioLevel() * 256);
- std::string json_data = writer.write(root);
+ uint32_t audio_level = (uint32_t) ((F32) mWebRTCDeviceInterface->getAudioLevel() * 256);
+ if (audio_level != mAudioLevel)
+ {
+ 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);
+ mWebRTCDataInterface->sendData(json_data, false);
+ mAudioLevel = audio_level;
+ }
}