Skip to content

Commit

Permalink
replay: fix issue when original logfile had topics with zero timstamps
Browse files Browse the repository at this point in the history
Signed-off-by: CarlOlsson <[email protected]>
  • Loading branch information
CarlOlsson authored and mhkabir committed Mar 25, 2019
1 parent 3d27124 commit ed2d4f6
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/modules/replay/replay_main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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];
Expand All @@ -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;
}
Expand Down

0 comments on commit ed2d4f6

Please sign in to comment.