Skip to content

Commit 494f6a1

Browse files
authored
Restore video frame limit on unpause (#16183)
1 parent 7558c99 commit 494f6a1

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

runloop.c

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4782,6 +4782,7 @@ void runloop_pause_checks(void)
47824782
presence_userdata_t userdata;
47834783
#endif
47844784
video_driver_state_t *video_st = video_state_get_ptr();
4785+
settings_t *settings = config_get_ptr();
47854786
runloop_state_t *runloop_st = &runloop_state;
47864787
bool is_paused = (runloop_st->flags & RUNLOOP_FLAG_PAUSED) ? true : false;
47874788
bool is_idle = (runloop_st->flags & RUNLOOP_FLAG_IDLE) ? true : false;
@@ -4819,12 +4820,21 @@ void runloop_pause_checks(void)
48194820
#ifdef HAVE_LAKKA
48204821
set_cpu_scaling_signal(CPUSCALING_EVENT_FOCUS_MENU);
48214822
#endif
4823+
4824+
/* Limit paused frames to video refresh. */
4825+
runloop_st->frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f /
4826+
((video_st->video_refresh_rate_original)
4827+
? video_st->video_refresh_rate_original
4828+
: settings->floats.video_refresh_rate));
48224829
}
48234830
else
48244831
{
48254832
#ifdef HAVE_LAKKA
48264833
set_cpu_scaling_signal(CPUSCALING_EVENT_FOCUS_CORE);
48274834
#endif
4835+
4836+
/* Restore frame limit. */
4837+
runloop_set_frame_limit(&video_st->av_info, settings->floats.fastforward_ratio);
48284838
}
48294839

48304840
#if defined(HAVE_TRANSLATE) && defined(HAVE_GFX_WIDGETS)
@@ -6958,12 +6968,6 @@ int runloop_iterate(void)
69586968
netplay_driver_ctl(RARCH_NETPLAY_CTL_PAUSE, NULL);
69596969
#endif
69606970
video_driver_cached_frame();
6961-
6962-
/* Limit paused video refresh. */
6963-
runloop_st->frame_limit_minimum_time = (retro_time_t)roundf(1000000.0f /
6964-
((video_st->video_refresh_rate_original)
6965-
? video_st->video_refresh_rate_original
6966-
: settings->floats.video_refresh_rate));
69676971
goto end;
69686972
case RUNLOOP_STATE_MENU:
69696973
#ifdef HAVE_NETWORKING

0 commit comments

Comments
 (0)