From 33ed88287fe271fcc51361b798b820f274b3b0a6 Mon Sep 17 00:00:00 2001 From: Jakob Ivarsson Date: Fri, 18 Oct 2019 12:39:42 +0200 Subject: [PATCH] Update the minimum bitrate when a stream allocation is removed. The minimum bitrate was lower bounded by the previous value and could thus not become lower when a stream allocation was removed. Bug: None Change-Id: I60068dbc7691121f001cbb233ca4a25269047f6e Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/157424 Reviewed-by: Sebastian Jansson Commit-Queue: Jakob Ivarsson Cr-Commit-Position: refs/heads/master@{#29541} --- .../goog_cc/goog_cc_network_control.cc | 7 ++++--- .../goog_cc/goog_cc_network_control.h | 1 + 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc index 621fd4c542..c731d71c26 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control.cc +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.cc @@ -325,9 +325,10 @@ void GoogCcNetworkController::ClampConstraints() { // and that we don't try to set the min bitrate to 0 from any applications. // The congestion controller should allow a min bitrate of 0. min_data_rate_ = - std::max(min_data_rate_, congestion_controller::GetMinBitrate()); - if (use_min_allocatable_as_lower_bound_) + std::max(min_target_rate_, congestion_controller::GetMinBitrate()); + if (use_min_allocatable_as_lower_bound_) { min_data_rate_ = std::max(min_data_rate_, min_total_allocated_bitrate_); + } if (max_data_rate_ < min_data_rate_) { RTC_LOG(LS_WARNING) << "max bitrate smaller than min bitrate"; max_data_rate_ = min_data_rate_; @@ -340,7 +341,7 @@ void GoogCcNetworkController::ClampConstraints() { std::vector GoogCcNetworkController::ResetConstraints( TargetRateConstraints new_constraints) { - min_data_rate_ = new_constraints.min_data_rate.value_or(DataRate::Zero()); + min_target_rate_ = new_constraints.min_data_rate.value_or(DataRate::Zero()); max_data_rate_ = new_constraints.max_data_rate.value_or(DataRate::PlusInfinity()); starting_rate_ = new_constraints.starting_rate; diff --git a/modules/congestion_controller/goog_cc/goog_cc_network_control.h b/modules/congestion_controller/goog_cc/goog_cc_network_control.h index bc7b66f9da..0c4fca0e0e 100644 --- a/modules/congestion_controller/goog_cc/goog_cc_network_control.h +++ b/modules/congestion_controller/goog_cc/goog_cc_network_control.h @@ -104,6 +104,7 @@ class GoogCcNetworkController : public NetworkControllerInterface { absl::optional initial_config_; + DataRate min_target_rate_ = DataRate::Zero(); DataRate min_data_rate_ = DataRate::Zero(); DataRate max_data_rate_ = DataRate::PlusInfinity(); absl::optional starting_rate_;