Skip to content

Commit

Permalink
Restore video frame limit on unpause (#16183)
Browse files Browse the repository at this point in the history
  • Loading branch information
sonninnos authored Jan 31, 2024
1 parent 7558c99 commit 494f6a1
Showing 1 changed file with 10 additions and 6 deletions.
16 changes: 10 additions & 6 deletions runloop.c
Original file line number Diff line number Diff line change
Expand Up @@ -4782,6 +4782,7 @@ void runloop_pause_checks(void)
presence_userdata_t userdata;
#endif
video_driver_state_t *video_st = video_state_get_ptr();
settings_t *settings = config_get_ptr();
runloop_state_t *runloop_st = &runloop_state;
bool is_paused = (runloop_st->flags & RUNLOOP_FLAG_PAUSED) ? true : false;
bool is_idle = (runloop_st->flags & RUNLOOP_FLAG_IDLE) ? true : false;
Expand Down Expand Up @@ -4819,12 +4820,21 @@ void runloop_pause_checks(void)
#ifdef HAVE_LAKKA
set_cpu_scaling_signal(CPUSCALING_EVENT_FOCUS_MENU);
#endif

/* Limit paused frames to video refresh. */
runloop_st->frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f /
((video_st->video_refresh_rate_original)
? video_st->video_refresh_rate_original
: settings->floats.video_refresh_rate));
}
else
{
#ifdef HAVE_LAKKA
set_cpu_scaling_signal(CPUSCALING_EVENT_FOCUS_CORE);
#endif

/* Restore frame limit. */
runloop_set_frame_limit(&video_st->av_info, settings->floats.fastforward_ratio);
}

#if defined(HAVE_TRANSLATE) && defined(HAVE_GFX_WIDGETS)
Expand Down Expand Up @@ -6958,12 +6968,6 @@ int runloop_iterate(void)
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
#endif
video_driver_cached_frame();

/* Limit paused video refresh. */
runloop_st->frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f /
((video_st->video_refresh_rate_original)
? video_st->video_refresh_rate_original
: settings->floats.video_refresh_rate));
goto end;
case RUNLOOP_STATE_MENU:
#ifdef HAVE_NETWORKING
Expand Down

0 comments on commit 494f6a1

Please sign in to comment.