mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-26 07:17:23 +00:00
[client] check for underflow when checking frame time
This commit is contained in:
parent
4441427943
commit
08062e3fc3
@ -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);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user