diff options
| author | Maxim Nikolenko <maximnproductengine@lindenlab.com> | 2026-05-21 17:47:14 +0300 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2026-05-21 17:47:14 +0300 |
| commit | 5e03a1b32ce69760cf293401ece7f631322f9fe9 (patch) | |
| tree | 951453851bbe0cf9b7a720e5cb3e466b02f9d5ce /indra/newview | |
| parent | 9c2ee024bef564ebb6e2e8942b43ffae1d99232c (diff) | |
#5732 fix showing incorrect 'Packets Lost' statistic
Diffstat (limited to 'indra/newview')
| -rw-r--r-- | indra/newview/llvoicewebrtc.cpp | 14 |
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")) { |
