mirror of https://github.com/snes9xgit/snes9x.git
Update config variable and sanitize input.
This commit is contained in:
parent
618519457b
commit
1369d724f7
|
@ -475,7 +475,7 @@ void S9xSetSamplesAvailableCallback (apu_callback callback, void *data)
|
|||
|
||||
void S9xUpdateDynamicRate (int avail, int buffer_size)
|
||||
{
|
||||
spc::dynamic_rate_multiplier = 1.0 + ((int) Settings.DynamicRateLimit * (buffer_size - 2 * avail)) /
|
||||
spc::dynamic_rate_multiplier = 1.0 + (Settings.DynamicRateLimit * (buffer_size - 2 * avail)) /
|
||||
(double)(1000 * buffer_size);
|
||||
|
||||
UpdatePlaybackRate();
|
||||
|
|
|
@ -253,8 +253,8 @@ Snes9xConfig::load_defaults (void)
|
|||
Settings.FrameTime = Settings.FrameTimeNTSC;
|
||||
Settings.BlockInvalidVRAMAccessMaster = TRUE;
|
||||
Settings.SoundSync = 1;
|
||||
Settings.DynamicRateControl = 0;
|
||||
Settings.DynamicRateLimit = 1000;
|
||||
Settings.DynamicRateControl = 1;
|
||||
Settings.DynamicRateLimit = 5;
|
||||
Settings.HDMATimingHack = 100;
|
||||
Settings.ApplyCheats = 1;
|
||||
|
||||
|
@ -675,6 +675,7 @@ Snes9xConfig::set_option (const char *name, const char *value)
|
|||
else if (!strcasecmp (name, "dynamic_rate_limit"))
|
||||
{
|
||||
Settings.DynamicRateLimit = atoi (value);
|
||||
Settings.DynamicRateLimit = CLAMP (Settings.DynamicRateLimit, 1, 1000);
|
||||
}
|
||||
else if (!strcasecmp (name, "gaussian_interpolation"))
|
||||
{
|
||||
|
|
|
@ -423,7 +423,7 @@ void S9xLoadConfigFiles (char **argv, int argc)
|
|||
Settings.SoundInputRate = conf.GetUInt("Sound::InputRate", 32000);
|
||||
Settings.Mute = conf.GetBool("Sound::Mute", false);
|
||||
Settings.DynamicRateControl = conf.GetBool("Sound::DynamicRateControl", false);
|
||||
Settings.DynamicRateLimit = conf.GetUInt("Sound::DynamicRateLimit", 1000);
|
||||
Settings.DynamicRateLimit = conf.GetInt ("Sound::DynamicRateLimit", 5);
|
||||
|
||||
// Display
|
||||
|
||||
|
|
Loading…
Reference in New Issue