Clamp stable target bitrate to min/max allocated bitrate.

Currently, the stable target can grow to 2x the max allocated bitrate.

Bug: None
Change-Id: I71657cb49ebebd429aae0bcd2e2978938252115c
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/170222
Reviewed-by: Sam Zackrisson <saza@webrtc.org>
Reviewed-by: Sebastian Jansson <srte@webrtc.org>
Commit-Queue: Jakob Ivarsson <jakobi@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30776}
This commit is contained in:
Jakob Ivarsson 2020-03-11 09:18:59 +01:00 committed by Commit Bot
parent d82a02c837
commit 0c96449305

View File

@ -507,6 +507,7 @@ uint32_t AudioSendStream::OnBitrateUpdated(BitrateAllocationUpdate update) {
// higher than max to allow for e.g. extra FEC.
auto constraints = GetMinMaxBitrateConstraints();
update.target_bitrate.Clamp(constraints.min, constraints.max);
update.stable_target_bitrate.Clamp(constraints.min, constraints.max);
channel_send_->OnBitrateAllocation(update);