diff --git a/src/modules/replay/replay_main.cpp b/src/modules/replay/replay_main.cpp index b76fe1a01d27ff70bd146b73dc31f2c74e5b2c7c..b141e4c5059e15474af017c28594ed3b9d7503f5 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; }