mirror of
https://github.com/gnif/LookingGlass.git
synced 2025-01-22 03:38:10 +00:00
[client] only resync the timer if we got an early frame
This prevents a slow update (ie, 30ups) from pulling the refresh rate below the minimum (ie, 60fps).
This commit is contained in:
parent
5c912e3c27
commit
f9b6dcc986
2 changed files with 8 additions and 4 deletions
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
|||
B2-rc4-6-g7e362050f7+1
|
||||
B2-rc4-7-g5c912e3c27+1
|
|
@ -213,12 +213,16 @@ static int renderThread(void * unused)
|
|||
if (atomic_fetch_sub_explicit(&a_framesPending, 1, memory_order_release) > 1)
|
||||
continue;
|
||||
|
||||
if (lgWaitEventAbs(e_frame, &time))
|
||||
if (lgWaitEventAbs(e_frame, &time) && state.frameTime > 0)
|
||||
{
|
||||
if (state.frameTime > 0)
|
||||
/* only resync the timer if we got an early frame */
|
||||
struct timespec now, diff;
|
||||
clock_gettime(CLOCK_REALTIME, &now);
|
||||
tsDiff(&diff, &now, &time);
|
||||
if (diff.tv_sec == 0 && diff.tv_nsec < state.frameTime)
|
||||
{
|
||||
resyncCheck = 0;
|
||||
clock_gettime(CLOCK_REALTIME, &time);
|
||||
memcpy(&time, &now, sizeof(struct timespec));
|
||||
tsAdd(&time, state.frameTime);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue