mirror of
https://gitee.com/xiaohuolufeihua/bizhang_-obav.git
synced 2026-05-22 09:28:58 +00:00
replay: check if topic timestamp is smaller than logging start
This could happen and then the sleep duration would wrap and be huge.
This commit is contained in:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user