[client] check for underflow when checking frame time

This commit is contained in:
Geoffrey McRae
2020-05-22 22:02:44 +10:00
parent 4441427943
commit 08062e3fc3
2 changed files with 3 additions and 2 deletions

View File

@@ -168,7 +168,8 @@ static int renderThread(void * unused)
struct timespec end, diff;
clock_gettime(CLOCK_REALTIME, &end);
tsDiff(&diff, &time, &end);
if (diff.tv_sec > 0 || diff.tv_nsec > 1000000000) // 100ms
if (diff.tv_sec > 0 || diff.tv_nsec > 1000000000 || // 100ms
diff.tv_sec < 0 || diff.tv_nsec < 0) // underflow
clock_gettime(CLOCK_REALTIME, &time);
}
}