From 992a868393f322593e69d8a44d79dcb8c2f32a46 Mon Sep 17 00:00:00 2001 From: Christoffer Rodbro Date: Tue, 30 Oct 2018 15:14:36 +0100 Subject: [PATCH] Fix for clock reset repair. Bug: none Change-Id: I9a7ebbc75f1cc222e2b1b9c8ef546e54710275e8 Reviewed-on: https://webrtc-review.googlesource.com/c/108600 Commit-Queue: Christoffer Rodbro Reviewed-by: Niels Moller Cr-Commit-Position: refs/heads/master@{#25434} --- call/call.cc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/call/call.cc b/call/call.cc index fa20679221..1ecaa613e9 100644 --- a/call/call.cc +++ b/call/call.cc @@ -1216,10 +1216,10 @@ PacketReceiver::DeliveryStatus Call::DeliverRtp(MediaType media_type, 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 {