Rockbox open source high quality audio player as a Music Player Daemon
mpris rockbox mpd libadwaita audio rust zig deno
2
fork

Configure Feed

Select the types of activity you want to include in your feed.

[Bug Fix] setting.c fail to check F_TABLE_SETTING w/o arbitrary values

table settings have a list of valid values when
they do not have F_ALLOW_ARBITRARY_VALS flag

they were not being treated as such

Change-Id: Ib02643a65ee4fc2abb1be8563a1849076de2f708

authored by

William Wilgus and committed by
William Wilgus
5903cd4b 222ff0cb

+23 -3
+21 -1
apps/settings.c
··· 394 394 else if (setting->flags & F_ALLOW_ARBITRARY_VALS) 395 395 { 396 396 *v = atoi(value); 397 - logf("Val: %s\r\n",value); 397 + logf("Val: %s = %d\r\n", value, *v); 398 398 } 399 + else if (setting->flags & F_TABLE_SETTING) 400 + { 401 + const struct table_setting *info = setting->table_setting; 402 + temp = atoi(value); 403 + *v = setting->default_val.int_; 404 + if (info->values) 405 + { 406 + for(int i = 0; i < info->count; i++) 407 + { 408 + if (info->values[i] == temp) 409 + { 410 + *v = temp; 411 + break; 412 + } 413 + } 414 + } 415 + logf("Val: %s", *v == temp ? "Found":"Error Not Found"); 416 + logf("Val: %s = %d\r\n", value, *v); 417 + } 418 + 399 419 else 400 420 { 401 421 logf("Error: %s: Not Found! [%s]\r\n",
+2 -2
apps/settings_list.c
··· 1644 1644 OFFON_SETTING(F_SOUNDSETTING, dithering_enabled, LANG_DITHERING, false, 1645 1645 "dithering enabled", dsp_dither_enable), 1646 1646 /* surround */ 1647 - TABLE_SETTING(F_TIME_SETTING | F_SOUNDSETTING | F_ALLOW_ARBITRARY_VALS, 1648 - surround_enabled, LANG_SURROUND, 0, "surround enabled", off, 1647 + TABLE_SETTING(F_TIME_SETTING | F_SOUNDSETTING, surround_enabled, 1648 + LANG_SURROUND, 0, "surround enabled", off, 1649 1649 UNIT_MS, formatter_time_unit_0_is_off, 1650 1650 getlang_time_unit_0_is_off, 1651 1651 dsp_surround_enable, 6,