mirror of
https://github.com/libretro/RetroArch
synced 2025-01-29 18:32:44 +00:00
Sanitize fastforward_ratio value when loading a config file
in case it's <= 0.0
This commit is contained in:
parent
557789a479
commit
b7d47f3df9
@ -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);
|
||||
|
||||
|
@ -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");
|
||||
|
Loading…
x
Reference in New Issue
Block a user