From 1899d9f1da2541cda75ffcbfa530ee81ceb865dc Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Sun, 9 Aug 2020 15:55:12 +1000 Subject: [PATCH] [client] reset the frame time when we get a frame signal This stops a duplicate frame rendering bug due to failure to discipline based on the signal timing. --- VERSION | 2 +- client/src/main.c | 10 +++++++++- 2 files changed, 10 insertions(+), 2 deletions(-) diff --git a/VERSION b/VERSION index 61852038..75cd92ae 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -B2-rc2-29-g302b988524+1 \ No newline at end of file +B2-rc2-30-gfb9b772db0+1 \ No newline at end of file diff --git a/client/src/main.c b/client/src/main.c index fa51e6d2..902cb6bd 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -213,7 +213,15 @@ static int renderThread(void * unused) if (atomic_fetch_sub_explicit(&a_framesPending, 1, memory_order_release) > 1) continue; - lgWaitEventAbs(e_frame, &time); + if (lgWaitEventAbs(e_frame, &time)) + { + if (state.frameTime > 0) + { + resyncCheck = 0; + clock_gettime(CLOCK_REALTIME, &time); + tsAdd(&time, state.frameTime); + } + } } }