mirror of
https://github.com/GoldenCheetah/GoldenCheetah.git
synced 2026-02-13 16:18:42 +00:00
Fit files sometimes go backwards
FIT record type '253' occasionally causes time to go backwards, this might be a decoding error, but for now we force time to go forward anyway. Looking at bad files GPS data with this patch suggests this is the correct behaviour. Fixes #104.
This commit is contained in:
@@ -326,7 +326,11 @@ struct FitFileReaderState
|
||||
continue;
|
||||
|
||||
switch (field.num) {
|
||||
case 253: time = value + qbase_time.toTime_t(); break;
|
||||
case 253: time = value + qbase_time.toTime_t();
|
||||
// Time MUST NOT go backwards
|
||||
// You canny break the laws of physics, Jim
|
||||
if (time < last_time) time = last_time;
|
||||
break;
|
||||
case 0: lati = value; break;
|
||||
case 1: lngi = value; break;
|
||||
case 2: alt = value / 5.0 - 500.0; break;
|
||||
|
||||
Reference in New Issue
Block a user