Prevents probing while paused.

The pacing controller allowed sending bitrate probes, despite it being
paused. This CL adresses that, and makes sure the task-queue based mode
also properly repsects pausing.

Bug: webrtc:10809
Change-Id: I79643c9a24666110d7583fce3ed1bfd6865e9e10
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/162520
Reviewed-by: Florent Castelli <orphis@webrtc.org>
Commit-Queue: Erik Språng <sprang@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#30109}
This commit is contained in:
Erik Språng
2019-12-17 17:49:49 +01:00
committed by Commit Bot
parent 768c5f438c
commit ae10029bff
2 changed files with 34 additions and 4 deletions

View File

@ -308,6 +308,10 @@ bool PacingController::ShouldSendKeepalive(Timestamp now) const {
Timestamp PacingController::NextSendTime() const {
Timestamp now = CurrentTime();
if (paused_) {
return last_send_time_ + kPausedProcessInterval;
}
// If probing is active, that always takes priority.
if (prober_.IsProbing()) {
Timestamp probe_time = prober_.NextProbeTime(now);
@ -318,10 +322,7 @@ Timestamp PacingController::NextSendTime() const {
}
if (mode_ == ProcessMode::kPeriodic) {
// In periodc non-probing mode, we just have a fixed interval.
if (paused_) {
return last_send_time_ + kPausedProcessInterval;
}
// In periodic non-probing mode, we just have a fixed interval.
return last_process_time_ + min_packet_limit_;
}