From c301891ff5d151f475d1f26e40ae9bc26dc6a678 Mon Sep 17 00:00:00 2001 From: Cameron Gutman Date: Sat, 5 Dec 2020 20:38:30 -0600 Subject: [PATCH] Fix stats overlay being off by 1 FPS --- Limelight/Stream/Connection.m | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/Limelight/Stream/Connection.m b/Limelight/Stream/Connection.m index 8b898fd..630ac06 100644 --- a/Limelight/Stream/Connection.m +++ b/Limelight/Stream/Connection.m @@ -118,7 +118,9 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit) } else { // Flip stats roughly every second - if (now - currentVideoStats.startTime > 1.0f) { + if (now - currentVideoStats.startTime >= 1.0f) { + currentVideoStats.endTime = now; + [videoStatsLock lock]; lastVideoStats = currentVideoStats; [videoStatsLock unlock]; @@ -135,7 +137,6 @@ int DrSubmitDecodeUnit(PDECODE_UNIT decodeUnit) currentVideoStats.receivedFrames++; currentVideoStats.totalFrames++; - currentVideoStats.endTime = now; PLENTRY entry = decodeUnit->bufferList; while (entry != NULL) {