mirror of
https://github.com/gnif/LookingGlass.git
synced 2024-11-14 21:17:54 +00:00
[client] we are getting the clock anyway, just reset the time
This commit is contained in:
parent
302b988524
commit
fb9b772db0
2 changed files with 3 additions and 13 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
B2-rc2-28-g19c2fe9b5e+1
|
||||
B2-rc2-29-g302b988524+1
|
|
@ -159,22 +159,12 @@ static int renderThread(void * unused)
|
|||
{
|
||||
if (state.frameTime > 0)
|
||||
{
|
||||
tsAdd(&time, state.frameTime);
|
||||
|
||||
// if our clock is too far out of sync, resync it
|
||||
// this can happen when switching to/from a TTY, or due to clock drift
|
||||
// we only check this once every 100 frames
|
||||
if (++resyncCheck == 100)
|
||||
{
|
||||
resyncCheck = 0;
|
||||
|
||||
struct timespec end, diff;
|
||||
clock_gettime(CLOCK_REALTIME, &end);
|
||||
tsDiff(&diff, &time, &end);
|
||||
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);
|
||||
}
|
||||
tsAdd(&time, state.frameTime);
|
||||
}
|
||||
|
||||
if (state.lgrResize)
|
||||
|
|
Loading…
Reference in a new issue