Fixes incorrect probe timing check.
In a recent CL, a line that puts a lower bound of 0 on time to next probe was omitted: https://webrtc-review.googlesource.com/c/src/+/158841/7/modules/pacing/bitrate_prober.cc#b143 That cause a misinterpretation in https://webrtc-review.googlesource.com/c/src/+/158841/7/modules/pacing/pacing_controller.cc#290 which may lead to probes aborting if the module processing thread sleeps a little too long. Bug: webrtc:10809 Change-Id: I672375fb213782e4e1f2215252f50894d7655f97 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/159023 Commit-Queue: Erik Språng <sprang@webrtc.org> Reviewed-by: Sebastian Jansson <srte@webrtc.org> Cr-Commit-Position: refs/heads/master@{#29728}
This commit is contained in:
@ -283,11 +283,7 @@ Timestamp PacingController::NextProbeTime() {
|
||||
return probe_time;
|
||||
}
|
||||
|
||||
if (probe_time > now) {
|
||||
return probe_time;
|
||||
}
|
||||
|
||||
if (probing_send_failure_ || now - probe_time > TimeDelta::ms(1)) {
|
||||
if (probe_time <= now && probing_send_failure_) {
|
||||
return Timestamp::PlusInfinity();
|
||||
}
|
||||
|
||||
|
||||
@ -1161,14 +1161,16 @@ TEST_F(PacingControllerTest, SkipsProbesWhenProcessIntervalTooLarge) {
|
||||
// We're exactly where we should be for the next probe.
|
||||
EXPECT_TRUE(pacer_->NextProbeTime().IsFinite());
|
||||
|
||||
// Advance to within one millisecond past where the next probe should be sent,
|
||||
// will still indicate "process immediately".
|
||||
clock_.AdvanceTime(TimeDelta::us(500));
|
||||
FieldTrialBasedConfig field_trial_config;
|
||||
BitrateProberConfig probing_config(&field_trial_config);
|
||||
EXPECT_GT(probing_config.max_probe_delay.Get(), TimeDelta::Zero());
|
||||
|
||||
// Advance to within max probe delay.
|
||||
clock_.AdvanceTime(probing_config.max_probe_delay.Get());
|
||||
EXPECT_TRUE(pacer_->NextProbeTime().IsFinite());
|
||||
|
||||
// We've gone more than one millisecond past the time for the next probe
|
||||
// packet, it will dropped.
|
||||
clock_.AdvanceTime(TimeDelta::ms(1));
|
||||
// Too high probe delay, drop it!
|
||||
clock_.AdvanceTime(TimeDelta::us(1));
|
||||
EXPECT_EQ(pacer_->NextProbeTime(), Timestamp::PlusInfinity());
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user