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

Unified Diff: webrtc/modules/rtp_rtcp/source/time_util.h

Issue 1763823003: rtt calculation handles time go backwards (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Created 4 years, 9 months 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/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ('k') | webrtc/modules/rtp_rtcp/source/time_util.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: webrtc/modules/rtp_rtcp/source/time_util.h
diff --git a/webrtc/modules/rtp_rtcp/source/time_util.h b/webrtc/modules/rtp_rtcp/source/time_util.h
index a876b14d56f35c1eb11dd8b352287cf15bcdf134..5a9525ae62e9ab4b40891d10cdac85796e29102d 100644
--- a/webrtc/modules/rtp_rtcp/source/time_util.h
+++ b/webrtc/modules/rtp_rtcp/source/time_util.h
@@ -39,11 +39,9 @@ inline uint32_t CompactNtp(NtpTime ntp) {
return (ntp.seconds() << 16) | (ntp.fractions() >> 16);
}
// Converts interval between compact ntp timestamps to milliseconds.
-// This interval can be upto ~18.2 hours (2^16 seconds).
-inline uint32_t CompactNtpIntervalToMs(uint32_t compact_ntp_interval) {
- uint64_t value = static_cast<uint64_t>(compact_ntp_interval);
- return (value * 1000 + (1 << 15)) >> 16;
-}
+// This interval can be up to ~9.1 hours (2^15 seconds).
+// Values close to 2^16 seconds consider negative and result in minimum rtt = 1.
+int64_t CompactNtpRttToMs(uint32_t compact_ntp_interval);
} // namespace webrtc
#endif // WEBRTC_MODULES_RTP_RTCP_SOURCE_TIME_UTIL_H_
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl.cc ('k') | webrtc/modules/rtp_rtcp/source/time_util.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698