Fix for clock reset repair.
Bug: none
Change-Id: I9a7ebbc75f1cc222e2b1b9c8ef546e54710275e8
Reviewed-on: https://webrtc-review.googlesource.com/c/108600
Commit-Queue: Christoffer Rodbro <crodbro@webrtc.org>
Reviewed-by: Niels Moller <nisse@webrtc.org>
Cr-Commit-Position: refs/heads/master@{#25434}
diff --git a/call/call.cc b/call/call.cc
index fa20679..1ecaa61 100644
--- a/call/call.cc
+++ b/call/call.cc
@@ -1216,10 +1216,10 @@
if (packet_time_us != -1) {
if (receive_time_calculator_) {
- int64_t system_time_us =
- rtc::SystemTimeNanos() / rtc::kNumNanosecsPerMicrosec;
+ // Repair packet_time_us for clock resets by comparing a new read of
+ // the same clock (TimeUTCMicros) to a monotonic clock reading.
packet_time_us = receive_time_calculator_->ReconcileReceiveTimes(
- packet_time_us, system_time_us, clock_->TimeInMicroseconds());
+ packet_time_us, rtc::TimeUTCMicros(), clock_->TimeInMicroseconds());
}
parsed_packet.set_arrival_time_ms((packet_time_us + 500) / 1000);
} else {