video_replay: fix wait when using start_timestamp
which should not wait for the amount of time between the initial packet (which is ignored) and the packet video_replay was told to start at. BUG=webrtc:382396709 Change-Id: Ic9c465cfa3e0ab66d9c2ff2e8e56a5bf419b8687 Reviewed-on: https://webrtc-review.googlesource.com/c/src/+/370712 Commit-Queue: Philipp Hancke <phancke@meta.com> Reviewed-by: Mirko Bonadei <mbonadei@webrtc.org> Reviewed-by: Sergey Silkin <ssilkin@webrtc.org> Reviewed-by: Harald Alvestrand <hta@webrtc.org> Cr-Commit-Position: refs/heads/main@{#43750}
This commit is contained in:
parent
808c9a66cd
commit
da1c9e08ac
@ -590,10 +590,6 @@ class RtpReplayer final {
|
||||
|
||||
while (true) {
|
||||
int64_t now_ms = CurrentTimeMs();
|
||||
if (replay_start_ms == -1) {
|
||||
replay_start_ms = now_ms;
|
||||
}
|
||||
|
||||
test::RtpPacket packet;
|
||||
if (!rtp_reader_->NextPacket(&packet)) {
|
||||
break;
|
||||
@ -619,6 +615,9 @@ class RtpReplayer final {
|
||||
header.Timestamp() > stop_timestamp) {
|
||||
continue;
|
||||
}
|
||||
if (replay_start_ms == -1) {
|
||||
replay_start_ms = now_ms - packet.time_ms;
|
||||
}
|
||||
|
||||
int64_t deliver_in_ms = replay_start_ms + packet.time_ms - now_ms;
|
||||
SleepOrAdvanceTime(deliver_in_ms);
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user