sound, fix config save/load for native quality mode

This commit is contained in:
kub 2022-03-31 22:02:48 +00:00
parent e2e2b6ad1b
commit a987b67801
2 changed files with 8 additions and 3 deletions

View file

@ -275,8 +275,13 @@ static int custom_read(menu_entry *me, const char *var, const char *val)
case MA_OPT_SOUND_QUALITY:
if (strcasecmp(var, "Sound Quality") != 0) return 0;
PicoIn.sndRate = strtoul(val, &tmp, 10);
if (PicoIn.sndRate < 8000 || PicoIn.sndRate > 53267)
PicoIn.sndRate = 22050;
if (PicoIn.sndRate < 8000 || PicoIn.sndRate > 53267) {
if (strncasecmp(tmp, "native", 6) == 0) {
tmp += 6;
PicoIn.sndRate = 53000;
} else
PicoIn.sndRate = 22050;
}
if (*tmp == 'H' || *tmp == 'h') tmp++;
if (*tmp == 'Z' || *tmp == 'z') tmp++;
while (*tmp == ' ') tmp++;