Index: webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
diff --git a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
index 561fde939180b74e0cad8b606952487c984eabbd..d2b81e11903a1010d7c98302d1e37b80419d6572 100644 |
--- a/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
+++ b/webrtc/modules/congestion_controller/probe_bitrate_estimator.cc |
@@ -48,6 +48,7 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback( |
} |
AggregatedCluster* cluster = &clusters_[packet_info.probe_cluster_id]; |
+ |
cluster->first_send_ms = |
std::min(cluster->first_send_ms, packet_info.send_time_ms); |
cluster->last_send_ms = |
@@ -57,13 +58,13 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback( |
cluster->last_receive_ms = |
std::max(cluster->last_receive_ms, packet_info.arrival_time_ms); |
cluster->size += packet_info.payload_size * 8; |
- cluster->num_probes += 1; |
+ cluster->send_times_ms.insert(packet_info.send_time_ms); |
danilchap
2016/08/19 14:08:30
why is it needed?
|
// Clean up old clusters. |
while (clusters_.size() > kMaxNumSavedClusters) |
clusters_.erase(clusters_.begin()); |
- if (cluster->num_probes < kMinNumProbesValidCluster) |
+ if (cluster->send_times_ms.size() < kMinNumProbesValidCluster) |
danilchap
2016/08/19 14:08:30
If you worry two small padding packet is not enoug
|
return ProbingResult(); |
float send_interval_ms = cluster->last_send_ms - cluster->first_send_ms; |
@@ -74,7 +75,8 @@ ProbingResult ProbeBitrateEstimator::PacketFeedback( |
// the last/first packet we expand the interval by the average inverval |
// between the probing packets. |
float interval_correction = |
- static_cast<float>(cluster->num_probes) / (cluster->num_probes - 1); |
+ static_cast<float>(cluster->send_times_ms.size()) / |
+ (cluster->send_times_ms.size() - 1); |
send_interval_ms *= interval_correction; |
receive_interval_ms *= interval_correction; |