From ed2d4f6a9c2740ad874bcb944fe8d9b6ff16e005 Mon Sep 17 00:00:00 2001 From: CarlOlsson Date: Fri, 22 Mar 2019 16:16:10 +0100 Subject: [PATCH] replay: fix issue when original logfile had topics with zero timstamps Signed-off-by: CarlOlsson --- src/modules/replay/replay_main.cpp | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/modules/replay/replay_main.cpp b/src/modules/replay/replay_main.cpp index b76fe1a01d27..b141e4c5059e 100644 --- a/src/modules/replay/replay_main.cpp +++ b/src/modules/replay/replay_main.cpp @@ -773,6 +773,7 @@ void Replay::run() //to be in chronological order, so we need to check all subscriptions uint64_t next_file_time = 0; int next_msg_id = -1; + bool first_time = true; for (size_t i = 0; i < _subscriptions.size(); ++i) { const Subscription *subscription = _subscriptions[i]; @@ -782,7 +783,8 @@ void Replay::run() } if (subscription->orb_meta && !subscription->ignored) { - if (next_file_time == 0 || subscription->next_timestamp < next_file_time) { + if (first_time || subscription->next_timestamp < next_file_time) { + first_time = false; next_msg_id = (int)i; next_file_time = subscription->next_timestamp; }