summaryrefslogtreecommitdiff
path: root/indra/newview
diff options
context:
space:
mode:
authorMaxim Nikolenko <maximnproductengine@lindenlab.com>2026-05-21 17:47:14 +0300
committerGitHub <noreply@github.com>2026-05-21 17:47:14 +0300
commit5e03a1b32ce69760cf293401ece7f631322f9fe9 (patch)
tree951453851bbe0cf9b7a720e5cb3e466b02f9d5ce /indra/newview
parent9c2ee024bef564ebb6e2e8942b43ffae1d99232c (diff)
#5732 fix showing incorrect 'Packets Lost' statistic
Diffstat (limited to 'indra/newview')
-rw-r--r--indra/newview/llvoicewebrtc.cpp14
1 files changed, 8 insertions, 6 deletions
diff --git a/indra/newview/llvoicewebrtc.cpp b/indra/newview/llvoicewebrtc.cpp
index 3b98ca49ef..0125ea4e47 100644
--- a/indra/newview/llvoicewebrtc.cpp
+++ b/indra/newview/llvoicewebrtc.cpp
@@ -3429,9 +3429,10 @@ void LLVoiceWebRTCConnection::OnStatsDelivered(const llwebrtc::LLWebRTCStatsMap&
{
if (attributes.contains("packetsLost"))
{
- U32 out_packets_lost = 0;
- LLStringUtil::convertToU32(attributes.at("packetsLost"), out_packets_lost);
- sample(LLStatViewer::WEBRTC_PACKETS_OUT_LOST, out_packets_lost);
+ // packetsLost may be negative, clamp to zero for unsigned Viewer stats
+ S32 out_packets_lost = 0;
+ LLStringUtil::convertToS32(attributes.at("packetsLost"), out_packets_lost);
+ sample(LLStatViewer::WEBRTC_PACKETS_OUT_LOST, static_cast<U32>(llmax(out_packets_lost, 0)));
}
if (attributes.contains("jitter"))
{
@@ -3445,9 +3446,10 @@ void LLVoiceWebRTCConnection::OnStatsDelivered(const llwebrtc::LLWebRTCStatsMap&
{
if (attributes.contains("packetsLost"))
{
- U32 in_packets_lost = 0;
- LLStringUtil::convertToU32(attributes.at("packetsLost"), in_packets_lost);
- sample(LLStatViewer::WEBRTC_PACKETS_IN_LOST, in_packets_lost);
+ // packetsLost may be negative, clamp to zero for unsigned Viewer stats
+ S32 in_packets_lost = 0;
+ LLStringUtil::convertToS32(attributes.at("packetsLost"), in_packets_lost);
+ sample(LLStatViewer::WEBRTC_PACKETS_IN_LOST, static_cast<U32>(llmax(in_packets_lost, 0)));
}
if (attributes.contains("packetsReceived"))
{