1
0
mirror of https://bitbucket.org/librepilot/librepilot.git synced 2025-02-20 10:54:14 +01:00

Merged in filnet/librepilot/LP-485_gcs_log_speed_fix (pull request #393)

LP-485 GCS: Logfile replay playback speed too fast

Approved-by: Philippe Renon <philippe_renon@yahoo.fr>
Approved-by: Lalanne Laurent <f5soh@free.fr>
Approved-by: Alessio Morale <alessiomorale@gmail.com>
Approved-by: Harold Hankins <hwh@hjns.net>
Approved-by: Eric Price <corvuscorax@cybertrench.com>
This commit is contained in:
Philippe Renon 2017-03-21 21:35:03 +00:00 committed by Lalanne Laurent
commit ff81941aa5
2 changed files with 3 additions and 3 deletions

View File

@ -103,8 +103,8 @@ void LogFile::timerFired()
time = m_myTime.elapsed();
// TODO: going back in time will be a problem
while ((m_lastPlayed + ((time - m_timeOffset) * m_playbackSpeed) > m_lastTimeStamp)) {
m_lastPlayed += ((time - m_timeOffset) * m_playbackSpeed);
while ((m_lastPlayed + ((double)(time - m_timeOffset) * m_playbackSpeed) > m_lastTimeStamp)) {
m_lastPlayed += ((double)(time - m_timeOffset) * m_playbackSpeed);
if (m_file.bytesAvailable() < (qint64)sizeof(dataSize)) {
stopReplay();
return;

View File

@ -63,7 +63,7 @@ protected:
QTime m_myTime;
QFile m_file;
qint32 m_lastTimeStamp;
qint32 m_lastPlayed;
double m_lastPlayed;
QMutex m_mutex;