From 79241835c14a245c97d64aa2b71ee38062b68d40 Mon Sep 17 00:00:00 2001 From: Patrick Nicolas Date: Tue, 4 Jun 2024 19:17:47 +0200 Subject: [PATCH] Fix pacer bug from a8c99ea4c --- server/driver/wivrn_pacer.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/server/driver/wivrn_pacer.cpp b/server/driver/wivrn_pacer.cpp index fc4218a8..d90ad917 100644 --- a/server/driver/wivrn_pacer.cpp +++ b/server/driver/wivrn_pacer.cpp @@ -44,11 +44,11 @@ void wivrn_pacer::predict( std::lock_guard lock(mutex); auto now = os_monotonic_get_ns(); + next_frame_ns += frame_duration_ns; + if (next_frame_ns < now) next_frame_ns = now; - next_frame_ns += frame_duration_ns; - out_wake_up_time_ns = next_frame_ns; out_desired_present_time_ns = out_wake_up_time_ns + mean_wake_up_to_present_ns; out_present_slop_ns = 0;