diff --git a/retroarch.c b/retroarch.c index 9559e1b907..7360bed6ce 100644 --- a/retroarch.c +++ b/retroarch.c @@ -2531,15 +2531,10 @@ static inline void update_frame_time(void) static void limit_frame_time(void) { - double effective_fps, mft_f; retro_time_t current = rarch_get_time_usec(); retro_time_t target = 0, to_sleep_ms = 0; - float ffr = g_settings.fastforward_ratio; - - if (ffr <= 0.0) - ffr = -1.0; - effective_fps = (g_extern.system.av_info.timing.fps * ffr); - mft_f = 1000000.0f / effective_fps; + double effective_fps = (g_extern.system.av_info.timing.fps * g_settings.fastforward_ratio); + double mft_f = 1000000.0f / effective_fps; g_extern.frame_limit.minimum_frame_time = (retro_time_t) roundf(mft_f); diff --git a/settings.c b/settings.c index f97033b9dc..0c72ff4781 100644 --- a/settings.c +++ b/settings.c @@ -1087,6 +1087,12 @@ static bool config_load_file(const char *path, bool set_defaults) g_settings.slowmotion_ratio = 1.0f; CONFIG_GET_FLOAT(fastforward_ratio, "fastforward_ratio"); + + /* Sanitize fastforward_ratio value - previously range was -1 + * and up (with 0 being skipped) */ + if (g_settings.fastforward_ratio <= 0.0f) + g_settings.fastforward_ratio = 1.0f; + CONFIG_GET_BOOL(fastforward_ratio_throttle_enable, "fastforward_ratio_throttle_enable"); CONFIG_GET_BOOL(pause_nonactive, "pause_nonactive");