[client] check for underflow when checking frame time

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

No files matched your search

+2 -1
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);
}
}