Commit 58dde90 1 parent f51ea99 commit 58dde90 Copy full SHA for 58dde90
File tree 2 files changed +7
-6
lines changed
2 files changed +7
-6
lines changed Original file line number Diff line number Diff line change @@ -902,6 +902,7 @@ Replay::run()
902
902
903
903
PX4_INFO (" Replay in progress..." );
904
904
905
+ // Find and add all subscriptions
905
906
ulog_message_header_s message_header;
906
907
replay_file.seekg (_data_section_start);
907
908
@@ -910,22 +911,23 @@ Replay::run()
910
911
replay_file.read ((char *)&message_header, ULOG_MSG_HEADER_LEN);
911
912
912
913
if (!replay_file) {
914
+ // end of file
913
915
break ;
914
916
}
915
917
916
918
if (message_header.msg_type == (int )ULogMessageType::ADD_LOGGED_MSG) {
917
919
readAndAddSubscription (replay_file, message_header.msg_size );
918
920
919
- } else if (message_header.msg_type == (int )ULogMessageType::DATA) {
920
- // End of Definition & Data Section Message Header section
921
- break ;
922
-
923
921
} else {
924
922
// Not important for now, skip
925
923
replay_file.seekg (message_header.msg_size , ios::cur);
926
924
}
927
925
}
928
926
927
+ // Rewind back to the begining of the data section
928
+ replay_file.seekg (_data_section_start);
929
+ replay_file.clear ();
930
+
929
931
const uint64_t timestamp_offset = getTimestampOffset ();
930
932
uint32_t nr_published_messages = 0 ;
931
933
streampos last_additional_message_pos = _data_section_start;
Original file line number Diff line number Diff line change @@ -201,8 +201,7 @@ class Replay : public ModuleBase<Replay>
201
201
/* *
202
202
* Find next data message for this subscription, starting with the stored file offset.
203
203
* Skip the first message, and if found, read the timestamp and store the new file offset.
204
- * This also takes care of new subscriptions and parameter updates. When reaching EOF,
205
- * the subscription is set to invalid.
204
+ * When reaching EOF, the subscription is set to invalid.
206
205
* File seek position is arbitrary after this call.
207
206
* @return false on file error
208
207
*/
You can’t perform that action at this time.
0 commit comments