Don't reset initial constraints in congestion controller.
This avoids crashing if an application resets the starting bitrate before adding streams to the call. Bug: webrtc:9586 Change-Id: I8d31aba1f4fee40c67c8930f5a32d17700ccadc3 Reviewed-on: https://webrtc-review.googlesource.com/101680 Reviewed-by: Björn Terelius <terelius@webrtc.org> Commit-Queue: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#24808}
This commit is contained in:

committed by
Commit Bot

parent
380789761c
commit
d5fe67f958
@ -158,6 +158,8 @@ class SendSideCongestionController
|
||||
private:
|
||||
void MaybeCreateControllers() RTC_RUN_ON(task_queue_);
|
||||
void MaybeRecreateControllers() RTC_RUN_ON(task_queue_);
|
||||
void UpdateInitialConstraints(TargetRateConstraints new_contraints)
|
||||
RTC_RUN_ON(task_queue_);
|
||||
|
||||
void StartProcessPeriodicTasks() RTC_RUN_ON(task_queue_);
|
||||
void UpdateControllerWithTimeInterval() RTC_RUN_ON(task_queue_);
|
||||
|
@ -419,6 +419,14 @@ void SendSideCongestionController::MaybeRecreateControllers() {
|
||||
RTC_DCHECK(controller_);
|
||||
}
|
||||
|
||||
void SendSideCongestionController::UpdateInitialConstraints(
|
||||
TargetRateConstraints new_contraints) {
|
||||
if (!new_contraints.starting_rate)
|
||||
new_contraints.starting_rate = initial_config_.constraints.starting_rate;
|
||||
RTC_DCHECK(new_contraints.starting_rate);
|
||||
initial_config_.constraints = new_contraints;
|
||||
}
|
||||
|
||||
SendSideCongestionController::~SendSideCongestionController() = default;
|
||||
|
||||
void SendSideCongestionController::RegisterPacketFeedbackObserver(
|
||||
@ -452,7 +460,7 @@ void SendSideCongestionController::SetBweBitrates(int min_bitrate_bps,
|
||||
control_handler_->PostUpdates(
|
||||
controller_->OnTargetRateConstraints(constraints));
|
||||
} else {
|
||||
initial_config_.constraints = constraints;
|
||||
UpdateInitialConstraints(constraints);
|
||||
}
|
||||
});
|
||||
}
|
||||
@ -490,7 +498,7 @@ void SendSideCongestionController::OnNetworkRouteChanged(
|
||||
if (controller_) {
|
||||
control_handler_->PostUpdates(controller_->OnNetworkRouteChange(msg));
|
||||
} else {
|
||||
initial_config_.constraints = msg.constraints;
|
||||
UpdateInitialConstraints(msg.constraints);
|
||||
}
|
||||
pacer_controller_->OnNetworkRouteChange(msg);
|
||||
});
|
||||
|
Reference in New Issue
Block a user