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 <srte@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#29541}
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 621fd4c..c731d71 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 @@
   // 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 @@
 
 std::vector<ProbeClusterConfig> 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 bc7b66f..0c4fca0 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 @@
 
   absl::optional<NetworkControllerConfig> initial_config_;
 
+  DataRate min_target_rate_ = DataRate::Zero();
   DataRate min_data_rate_ = DataRate::Zero();
   DataRate max_data_rate_ = DataRate::PlusInfinity();
   absl::optional<DataRate> starting_rate_;