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:
parent
cb0164150e
commit
3c50e91a10
@ -440,8 +440,8 @@ divesystem_idive_parser_samples_foreach (dc_parser_t *abstract, dc_sample_callba
|
|||||||
|
|
||||||
// Time (seconds).
|
// Time (seconds).
|
||||||
unsigned int timestamp = array_uint32_le (data + offset + 2);
|
unsigned int timestamp = array_uint32_le (data + offset + 2);
|
||||||
if (timestamp <= time) {
|
if (timestamp <= time && time != 0) {
|
||||||
ERROR (abstract->context, "Timestamp moved backwards.");
|
ERROR (abstract->context, "Timestamp moved backwards (%u %u).", timestamp, time);
|
||||||
return DC_STATUS_DATAFORMAT;
|
return DC_STATUS_DATAFORMAT;
|
||||||
}
|
}
|
||||||
time = timestamp;
|
time = timestamp;
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user