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.