From c03dbf7255a8cde2a9dc4f9854622ce0cd27e38a Mon Sep 17 00:00:00 2001 From: Willem Melching Date: Tue, 28 Sep 2021 12:04:50 +0200 Subject: [PATCH] use start of frame time if set --- selfdrive/ui/replay/replay.cc | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/selfdrive/ui/replay/replay.cc b/selfdrive/ui/replay/replay.cc index 195a73d66cc8ca..0a26f51e2b262d 100644 --- a/selfdrive/ui/replay/replay.cc +++ b/selfdrive/ui/replay/replay.cc @@ -186,6 +186,13 @@ void Replay::stream() { const Event *evt = (*eit); cur_which = evt->which; cur_mono_time = evt->mono_time; + + if (evt->which == cereal::Event::ROAD_ENCODE_IDX) { + uint64_t sof = evt->event.getRoadEncodeIdx().getTimestampSof(); + if (sof > 0) { + cur_mono_time = sof; + } + } current_ts = (cur_mono_time - route_start_ts) / 1e9; std::string type;