Index: webrtc/p2p/base/port.cc |
diff --git a/webrtc/p2p/base/port.cc b/webrtc/p2p/base/port.cc |
index 565ddb67a60e24fe28f3eb838c88d517a5641512..6fea346841f569df3bbc39517ce086aaceff2aba 100644 |
--- a/webrtc/p2p/base/port.cc |
+++ b/webrtc/p2p/base/port.cc |
@@ -1252,8 +1252,12 @@ void Connection::ReceivedPingResponse(int rtt, const std::string& request_id) { |
UpdateReceiving(last_ping_response_received_); |
set_write_state(STATE_WRITABLE); |
set_state(IceCandidatePairState::SUCCEEDED); |
+ if (rtt_samples_ > 0) { |
+ rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1); |
+ } else { |
+ rtt_ = rtt; |
Taylor Brandstetter
2017/02/02 18:07:41
May make more sense in a separate CL, but it would
pthatcher2
2017/02/02 20:09:44
I agree that we should split it into "smoothed_rtt
skvlad
2017/02/02 22:19:33
Let's make it rtc::Optional in a separate CL. Ther
|
+ } |
rtt_samples_++; |
- rtt_ = (RTT_RATIO * rtt_ + rtt) / (RTT_RATIO + 1); |
} |
bool Connection::dead(int64_t now) const { |