From 9d54f62d3708797cf808583c9aef36350454f2e2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Beat=20K=C3=BCng?= Date: Wed, 1 Mar 2017 13:24:36 +0100 Subject: [PATCH] replay: check if topic timestamp is smaller than logging start This could happen and then the sleep duration would wrap and be huge. --- src/modules/replay/replay_main.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/modules/replay/replay_main.cpp b/src/modules/replay/replay_main.cpp index 11e990e4be..6a3d8fb941 100644 --- a/src/modules/replay/replay_main.cpp +++ b/src/modules/replay/replay_main.cpp @@ -690,8 +690,8 @@ void Replay::task_main() //wait if necessary const uint64_t publish_timestamp = next_file_time + timestamp_offset; uint64_t cur_time = hrt_absolute_time(); - - if (cur_time < publish_timestamp) { + // if some topics have a timestamp smaller than the log file start, publish them immediately + if (cur_time < publish_timestamp && next_file_time > _file_start_time) { usleep(publish_timestamp - cur_time); }