From 3bc8123247fea489f5d6a78ffe9518be2eee2c99 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Bj=C3=B6rn=20Terelius?= Date: Wed, 11 Mar 2020 15:22:24 +0100 Subject: [PATCH] Scale unacked_data consistently in RobustThroughputEstimator MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Bug: webrtc:10274 Change-Id: I4bb460ec13a17080a50750e59f87d7e972f9947b Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170232 Reviewed-by: Philip Eliasson Commit-Queue: Björn Terelius Cr-Commit-Position: refs/heads/master@{#30764} --- .../goog_cc/robust_throughput_estimator.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/modules/congestion_controller/goog_cc/robust_throughput_estimator.cc b/modules/congestion_controller/goog_cc/robust_throughput_estimator.cc index e5b1b963a5..1169e9f6bb 100644 --- a/modules/congestion_controller/goog_cc/robust_throughput_estimator.cc +++ b/modules/congestion_controller/goog_cc/robust_throughput_estimator.cc @@ -35,6 +35,9 @@ void RobustThroughputEstimator::IncomingPacketFeedbackVector( for (const auto& packet : packet_feedback_vector) { // Insert the new packet. window_.push_back(packet); + window_.back().sent_packet.prior_unacked_data = + window_.back().sent_packet.prior_unacked_data * + settings_.unacked_weight; // In most cases, receive timestamps should already be in order, but in the // rare case where feedback packets have been reordered, we do some swaps to // ensure that the window is sorted. @@ -80,8 +83,7 @@ absl::optional RobustThroughputEstimator::bitrate() const { min_recv_time = std::min(min_recv_time, packet.receive_time); max_recv_time = std::max(max_recv_time, packet.receive_time); data_size += packet.sent_packet.size; - data_size += - packet.sent_packet.prior_unacked_data * settings_.unacked_weight; + data_size += packet.sent_packet.prior_unacked_data; } // Suppose a packet of size S is sent every T milliseconds.