From 62e67c345c1a3694e9bb55bbdb3eab7790797142 Mon Sep 17 00:00:00 2001 From: Geoffrey McRae Date: Fri, 25 May 2018 08:35:52 +1000 Subject: [PATCH] [client] reduce weight of FPS limiter feedback --- client/main.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/client/main.c b/client/main.c index cd81ee10..99d6e050 100644 --- a/client/main.c +++ b/client/main.c @@ -66,7 +66,7 @@ struct AppState int shmFD; struct KVMFRHeader * shm; unsigned int shmSize; - unsigned int fpsSleep; + int64_t fpsSleep; }; typedef struct RenderOpts @@ -199,7 +199,9 @@ int renderThread(void * unused) { usleep(state.fpsSleep - total); int64_t delta = (1000000 / params.fpsLimit) - (microtime() - start); - state.fpsSleep += delta; + state.fpsSleep += delta / 16; + if (state.fpsSleep < 0) + state.fpsSleep = 0; } } else