Reset NetEq simulation step time if a large gap is detected.

Large gaps can cause issues in NetEq simulations, so the simulation is
ended whenever we encounter one. However, the time span of the gap is
still included in the simulation time, leading to incorrect results.

Bug: webrtc:10337
Change-Id: I94a1a0b46259e3718b1b73522a3886a17bedbb7d
Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/190287
Reviewed-by: Jakob Ivarsson <jakobi@webrtc.org>
Commit-Queue: Ivo Creusen <ivoc@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#32514}
This commit is contained in:
Ivo Creusen
2020-10-26 17:49:25 +01:00
committed by Commit Bot
parent 1b0d5437c9
commit b9b74569df

View File

@ -270,6 +270,11 @@ NetEqTest::SimulationStepResult NetEqTest::RunToNextGetAudio() {
// End the simulation if the gap is too large. This indicates an issue
// with the event log file.
const bool simulation_step_too_large = result.simulation_step_ms > 1000;
if (simulation_step_too_large) {
// If we don't reset the step time, the large gap will be included in
// the simulation time, which can be a large distortion.
result.simulation_step_ms = 10;
}
result.is_simulation_finished = simulation_step_too_large ||
no_more_packets_to_decode ||
input_->ended();