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

Unified Diff: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc

Issue 1763823003: rtt calculation handles time go backwards (Closed) Base URL: https://chromium.googlesource.com/external/webrtc.git@master
Patch Set: Comments added 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
Index: webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
diff --git a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
index 0259b73ff4e12fd666fda20d4b986df85d9d22bd..0098beb94030d5b2429e0b582c0d1fc32d6bf38f 100644
--- a/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
+++ b/webrtc/modules/rtp_rtcp/source/rtcp_receiver.cc
@@ -13,8 +13,6 @@
#include <assert.h>
#include <string.h>
-#include <algorithm>
-
#include "webrtc/base/checks.h"
#include "webrtc/base/logging.h"
#include "webrtc/base/trace_event.h"
@@ -521,7 +519,7 @@ void RTCPReceiver::HandleReportBlock(
}
uint32_t send_time = rtcpPacket.ReportBlockItem.LastSR;
- uint32_t rtt = 0;
+ int64_t rtt = 0;
if (send_time > 0) {
uint32_t delay = rtcpPacket.ReportBlockItem.DelayLastSR;
@@ -531,8 +529,7 @@ void RTCPReceiver::HandleReportBlock(
// RTT in 1/(2^16) seconds.
uint32_t rtt_ntp = receive_time - delay - send_time;
// Convert to 1/1000 seconds (milliseconds).
- uint32_t rtt_ms = CompactNtpIntervalToMs(rtt_ntp);
- rtt = std::max<uint32_t>(rtt_ms, 1);
+ rtt = CompactNtpRttToMs(rtt_ntp);
åsapersson 2016/03/08 12:59:44 I think this will now also result in RTT estimates
danilchap 2016/03/08 15:02:02 It shouldn't: send_time should be set to 0 to indi
åsapersson 2016/03/08 15:22:30 The receive stream(s) has the same main_ssrc_ as t
if (rtt > reportBlock->maxRTT) {
// Store max RTT.
reportBlock->maxRTT = rtt;
@@ -927,8 +924,7 @@ void RTCPReceiver::HandleXrDlrrReportBlockItem(
uint32_t now = CompactNtp(NtpTime(*_clock));
uint32_t rtt_ntp = now - delay_rr - send_time;
- uint32_t rtt_ms = CompactNtpIntervalToMs(rtt_ntp);
- xr_rr_rtt_ms_ = std::max<uint32_t>(rtt_ms, 1);
+ xr_rr_rtt_ms_ = CompactNtpRttToMs(rtt_ntp);
rtcpPacketInformation.rtcpPacketTypeFlags |= kRtcpXrDlrrReportBlock;
}

Powered by Google App Engine
This is Rietveld 408576698