[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

@ -1 +1 @@
B2-rc1-7-gf5da432d38+1 B2-rc1-8-g4441427943+1

View File

@ -168,7 +168,8 @@ static int renderThread(void * unused)
struct timespec end, diff; struct timespec end, diff;
clock_gettime(CLOCK_REALTIME, &end); clock_gettime(CLOCK_REALTIME, &end);
tsDiff(&diff, &time, &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); clock_gettime(CLOCK_REALTIME, &time);
} }
} }