diff --git a/rtc_tools/BUILD.gn b/rtc_tools/BUILD.gn index fb8bbe9718..08f2742528 100644 --- a/rtc_tools/BUILD.gn +++ b/rtc_tools/BUILD.gn @@ -397,6 +397,7 @@ if (!build_with_chromium) { "../rtc_base:rtc_base_approved", "../rtc_base:rtc_numerics", "../rtc_base:stringutils", + "../system_wrappers", "../test:explicit_key_value_config", ] absl_deps = [ diff --git a/rtc_tools/rtc_event_log_visualizer/log_simulation.cc b/rtc_tools/rtc_event_log_visualizer/log_simulation.cc index 0e5b5d04a9..4dbaf0b041 100644 --- a/rtc_tools/rtc_event_log_visualizer/log_simulation.cc +++ b/rtc_tools/rtc_event_log_visualizer/log_simulation.cc @@ -14,6 +14,7 @@ #include "logging/rtc_event_log/rtc_event_processor.h" #include "modules/rtp_rtcp/source/time_util.h" +#include "system_wrappers/include/clock.h" namespace webrtc { @@ -142,11 +143,13 @@ void LogBasedNetworkControllerSimulation::OnReceiverReport( HandleStateUpdate(controller_->OnTransportLossReport(msg)); } + Clock* clock = Clock::GetRealTimeClock(); TimeDelta rtt = TimeDelta::PlusInfinity(); for (auto& rb : report.rr.report_blocks()) { if (rb.last_sr()) { + Timestamp report_log_time = Timestamp::Micros(report.log_time_us()); uint32_t receive_time_ntp = - CompactNtp(TimeMicrosToNtp(report.log_time_us())); + CompactNtp(clock->ConvertTimestampToNtpTime(report_log_time)); uint32_t rtt_ntp = receive_time_ntp - rb.delay_since_last_sr() - rb.last_sr(); rtt = std::min(rtt, TimeDelta::Millis(CompactNtpRttToMs(rtt_ntp)));