Allow a zero timestamp for the first sample

Previously the timestamp of the first sample was always a non-zero
value, but the IX3M 2 with the APOS5 firmware now appears to record a
timestamp of zero. This was incorrectly detected as a backwards time
jump because the time is also initialized to zero.
This commit is contained in:
Jef Driesen 2023-10-29 19:56:40 +01:00
parent cb0164150e
commit 3c50e91a10

View File

@ -440,8 +440,8 @@ divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba
// Time (seconds).
unsigned int timestamp = array_uint32_le (data + offset + 2);
if (timestamp <= time) {
ERROR (abstract->context, "Timestamp moved backwards.");
if (timestamp <= time && time != 0) {
ERROR (abstract->context, "Timestamp moved backwards (%u %u).", timestamp, time);
return DC_STATUS_DATAFORMAT;
}
time = timestamp;