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 88bc9071364ea8f169f957cc9e9d38aa35f3f59e..3ef4c993f44032a7abf7b159deda37da93815b49 100644 |
| --- a/webrtc/modules/congestion_controller/congestion_controller.cc |
| +++ b/webrtc/modules/congestion_controller/congestion_controller.cc |
| @@ -171,6 +171,7 @@ CongestionController::CongestionController( |
| remote_estimator_proxy_(clock_, packet_router_.get()), |
| transport_feedback_adapter_(bitrate_controller_.get(), clock_), |
| min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), |
| + max_bitrate_bps_(0), |
| last_reported_bitrate_bps_(0), |
| last_reported_fraction_loss_(0), |
| last_reported_rtt_(0), |
| @@ -200,6 +201,7 @@ CongestionController::CongestionController( |
| remote_estimator_proxy_(clock_, packet_router_.get()), |
| transport_feedback_adapter_(bitrate_controller_.get(), clock_), |
| min_bitrate_bps_(RemoteBitrateEstimator::kDefaultMinBitrateBps), |
| + max_bitrate_bps_(0), |
| last_reported_bitrate_bps_(0), |
| last_reported_fraction_loss_(0), |
| last_reported_rtt_(0), |
| @@ -224,6 +226,16 @@ void CongestionController::SetBweBitrates(int min_bitrate_bps, |
| min_bitrate_bps, |
| max_bitrate_bps); |
| + { |
| + rtc::CritScope cs(&critsect_); |
| + if (last_reported_bitrate_bps_ != 0 && |
|
stefan-webrtc
2016/08/16 11:48:39
Add comment to explain why we don't do this if no
philipel
2016/08/16 13:04:31
Done.
|
| + last_reported_bitrate_bps_ < static_cast<uint32_t>(max_bitrate_bps) && |
| + max_bitrate_bps_ < max_bitrate_bps) { |
|
stefan-webrtc
2016/08/16 11:48:39
I think it's easier to read if we do max_bitrate_b
philipel
2016/08/16 13:04:31
Done.
|
| + pacer_->ProbeAtBitrate(max_bitrate_bps, 5); |
| + } |
| + } |
| + max_bitrate_bps_ = max_bitrate_bps; |
| + |
| if (remote_bitrate_estimator_) |
| remote_bitrate_estimator_->SetMinBitrate(min_bitrate_bps); |
| min_bitrate_bps_ = min_bitrate_bps; |
| @@ -241,6 +253,7 @@ void CongestionController::ResetBweAndBitrates(int bitrate_bps, |
| bitrate_controller_->ResetBitrates(bitrate_bps, min_bitrate_bps, |
| max_bitrate_bps); |
| min_bitrate_bps_ = min_bitrate_bps; |
| + max_bitrate_bps_ = max_bitrate_bps; |
| // TODO(honghaiz): Recreate this object once the remote bitrate estimator is |
| // no longer exposed outside CongestionController. |
| if (remote_bitrate_estimator_) |