Scale unacked_data consistently in RobustThroughputEstimator

Bug: webrtc:10274
Change-Id: I4bb460ec13a17080a50750e59f87d7e972f9947b
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170232
Reviewed-by: Philip Eliasson <philipel@webrtc.org>
Commit-Queue: Björn Terelius <terelius@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30764}
This commit is contained in:
Björn Terelius
2020-03-11 15:22:24 +01:00
committed by Commit Bot
parent 75d91faecc
commit 3bc8123247

View File

@ -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<DataRate> 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.