Skip to content

Commit

Permalink
Limit paused video refresh when vsync is disabled (libretro#16067)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Jan 2, 2024
1 parent 4220e56 commit 945ad4a
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down

0 comments on commit 945ad4a

Please sign in to comment.