Chromium Code Reviews| Index: webrtc/modules/congestion_controller/congestion_controller.cc |
| diff --git a/webrtc/modules/congestion_controller/congestion_controller.cc b/webrtc/modules/congestion_controller/congestion_controller.cc |
| index 5def7154e1bacfaa05d20eea9484e405e20d779d..f2722b487a6d690fd364f452fa3ecc93d42b5042 100644 |
| --- a/webrtc/modules/congestion_controller/congestion_controller.cc |
| +++ b/webrtc/modules/congestion_controller/congestion_controller.cc |
| @@ -170,6 +170,7 @@ CongestionController::CongestionController( |
| new RateLimiter(clock, kRetransmitWindowSizeMs)), |
| remote_estimator_proxy_(clock_, packet_router_.get()), |
| transport_feedback_adapter_(bitrate_controller_.get(), clock_), |
| + start_bitrate_bps_(0), |
| min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), |
| max_bitrate_bps_(0), |
| last_reported_bitrate_bps_(0), |
| @@ -228,14 +229,18 @@ void CongestionController::SetBweBitrates(int min_bitrate_bps, |
| min_bitrate_bps, |
| max_bitrate_bps); |
| + if (start_bitrate_bps > 0) |
| + start_bitrate_bps_ = start_bitrate_bps; |
| { |
| // Only do probing if: |
| // - we are mid-call, which we consider to be if |
|
philipel
2016/08/23 10:55:28
Nit: remove the last '-' since this is no longer a
|
| - // |last_reported_bitrate_bps_| != 0, and |
| - // - the current bitrate is lower than the new |max_bitrate_bps|, and |
| - // - we actually want to increase the |max_bitrate_bps_|. |
| + // |last_reported_bitrate_bps_| is valid (> 0) and |
| + // |last_reported_bitrate_bps_| != |start_bitrate_bps_|, and |
| + // the current bitrate is lower than the new |max_bitrate_bps|, and |
| + // we actually want to increase the |max_bitrate_bps_|. |
| rtc::CritScope cs(&critsect_); |
| - if (last_reported_bitrate_bps_ != 0 && |
| + if (last_reported_bitrate_bps_ && |
| + last_reported_bitrate_bps_ != start_bitrate_bps_ && |
| last_reported_bitrate_bps_ < max_bitrate_bps && |
| max_bitrate_bps > max_bitrate_bps_) { |
| pacer_->CreateProbeCluster(max_bitrate_bps, 5); |