Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(331)

Unified Diff: webrtc/api/rtcstatscollector.cc

Issue 2562703007: RTCOutboundRTPStreamStats.roundTripTime: Only report non-negative values. (Closed)
Patch Set: Unittest testing that it defaults to undefined Created 4 years ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/api/rtcstatscollector.cc
diff --git a/webrtc/api/rtcstatscollector.cc b/webrtc/api/rtcstatscollector.cc
index 5289c4820b916be021e1c23f34aab3cd75f562d7..f5d3e5f8b8526b92f41e02c06db172bb5aa9be24 100644
--- a/webrtc/api/rtcstatscollector.cc
+++ b/webrtc/api/rtcstatscollector.cc
@@ -197,8 +197,10 @@ void SetOutboundRTPStreamStatsFromMediaSenderInfo(
static_cast<uint32_t>(media_sender_info.packets_sent);
outbound_stats->bytes_sent =
static_cast<uint64_t>(media_sender_info.bytes_sent);
- outbound_stats->round_trip_time =
- static_cast<double>(media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec;
+ if (media_sender_info.rtt_ms >= 0) {
+ outbound_stats->round_trip_time = static_cast<double>(
+ media_sender_info.rtt_ms) / rtc::kNumMillisecsPerSec;
+ }
}
void SetOutboundRTPStreamStatsFromVoiceSenderInfo(
« no previous file with comments | « webrtc/api/rtcstats_integrationtest.cc ('k') | webrtc/api/rtcstatscollector_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698