From 945ad4a89f13c4f5f612321c0f859939ae4109af Mon Sep 17 00:00:00 2001 From: sonninnos <45124675+sonninnos@users.noreply.github.com> Date: Tue, 2 Jan 2024 20:01:19 +0200 Subject: [PATCH] Limit paused video refresh when vsync is disabled (#16067) --- runloop.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/runloop.c b/runloop.c index 9520b96226b3..8ca3408295f2 100644 --- a/runloop.c +++ b/runloop.c @@ -6939,6 +6939,17 @@ int runloop_iterate(void) netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL); #endif video_driver_cached_frame(); + + /* Limit paused video refresh when vsync is disabled */ + if (!settings->bools.video_vsync) + { + float refresh_rate = (video_st->video_refresh_rate_original) + ? video_st->video_refresh_rate_original : settings->floats.video_refresh_rate; + + runloop_st->frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f / refresh_rate); + goto end; + } + return 1; case RUNLOOP_STATE_MENU: #ifdef HAVE_NETWORKING