From 255f4ca63c89e0795b5a9daed66168c46bbe6a92 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Martin=20T=C5=AFma?= Date: Sun, 23 Jun 2019 10:18:56 +0200 Subject: [PATCH] Improved handling of track data with time skews --- src/data/track.cpp | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/data/track.cpp b/src/data/track.cpp index aa3fa9c5..cf3be062 100644 --- a/src/data/track.cpp +++ b/src/data/track.cpp @@ -99,8 +99,11 @@ Track::Track(const TrackData &data) : _data(data), _pause(0) if (sd.at(j).timestamp() >= sd.at(j-1).timestamp()) dt = sd.at(j-1).timestamp().msecsTo( sd.at(j).timestamp()) / 1000.0; - else - dt = NAN; + else { + qWarning("%s: %s: time skew detected", qPrintable(_data.name()), + qPrintable(sd.at(j).timestamp().toString(Qt::ISODate))); + dt = 0; + } seg.time.append(seg.time.last() + dt); if (dt < 1e-3) {