diff options
author | Roxie Linden <roxie@lindenlab.com> | 2024-09-09 15:12:40 -0700 |
---|---|---|
committer | Roxie Linden <roxie@lindenlab.com> | 2024-09-09 15:12:40 -0700 |
commit | 5f99c475dc89bd6293d157e85ad67cf6c832f578 (patch) | |
tree | 4ad1a72f619a8cfd488aee33f7ed15a6c329e67c /indra/newview/llvoicewebrtc.cpp | |
parent | b7c82a8e7a5efcf56cf8c60ecc4922cf2942b70e (diff) |
Voice bars of self and as seen by others do not appear the same.
The voice server sends up the float power level of peers as an integer
multiplied by 128, in order to save character count as the voice power level
will likely be only 3 digits, instead of many for a full float.
The client was not taking this into account.
Diffstat (limited to 'indra/newview/llvoicewebrtc.cpp')
-rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp index 4528b57061..7de8cf9cb1 100644 --- a/indra/newview/llvoicewebrtc.cpp +++ b/indra/newview/llvoicewebrtc.cpp @@ -2983,7 +2983,9 @@ void LLVoiceWebRTCConnection::OnDataReceivedImpl(const std::string &data, bool b // we got a 'power' update. if (participant_obj.contains("p") && participant_obj["p"].is_number()) { - participant->mLevel = (F32)participant_obj["p"].as_int64(); + // server sends up power as an integer which is level * 128 to save + // character count. + participant->mLevel = (F32)participant_obj["p"].as_int64()/128.0f; } if (participant_obj.contains("v") && participant_obj["v"].is_bool()) |