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

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

Issue 1491843004: [rtp_rtcp] RTT intermidiate calculation use ntp time instead of milliseconds. (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: rebase Created 4 years, 10 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_unittest.cc ('k') | no next file » | 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 5b544ddf9abc0b0cc98fff993ebb4ba2010306e2..a876b14d56f35c1eb11dd8b352287cf15bcdf134 100644
--- a/webrtc/modules/rtp_rtcp/source/time_util.h
+++ b/webrtc/modules/rtp_rtcp/source/time_util.h
@@ -41,7 +41,8 @@ inline uint32_t CompactNtp(NtpTime ntp) {
// 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) {
- return static_cast<uint64_t>(compact_ntp_interval) * 1000 / (1 << 16);
+ uint64_t value = static_cast<uint64_t>(compact_ntp_interval);
+ return (value * 1000 + (1 << 15)) >> 16;
}
} // namespace webrtc
« no previous file with comments | « webrtc/modules/rtp_rtcp/source/rtp_rtcp_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698