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.

settings: fix mismatched resume setting variable types

The SYSTEM_STATUS macro for these variables has an
F_T_INT flag, which may result in an unexpected value
being written to the resume file for PLM and PVS.

Change-Id: Iea18efbdc68604e1297721d132a9a5b7d056ffad

+12 -8
+1 -1
apps/playlist.c
··· 3789 3789 global_status.resume_crc32 = -1; 3790 3790 global_status.resume_elapsed = -1; 3791 3791 global_status.resume_offset = -1; 3792 - global_status.resume_modified = false; 3792 + global_status.resume_modified = 0; 3793 3793 status_save(true); 3794 3794 return -1; 3795 3795 }
+8 -4
apps/root_menu.c
··· 492 492 [GO_TO_SHORTCUTMENU] = { do_shortcut_menu, NULL, NULL }, 493 493 494 494 }; 495 - //static const int nb_items = sizeof(items)/sizeof(*items); 495 + #define NUM_ITEMS (int)(sizeof(items)/sizeof(*items)) 496 496 497 497 static int item_callback(int action, 498 498 const struct menu_item_ex *this_item, ··· 852 852 { 853 853 int new_screen = next_screen; 854 854 if (global_settings.start_in_screen == 0) 855 - new_screen = (int)global_status.last_screen; 856 - else new_screen = global_settings.start_in_screen - 2; 857 - if (new_screen == GO_TO_PLUGIN) 855 + new_screen = global_status.last_screen; 856 + else 857 + new_screen = global_settings.start_in_screen - 2; 858 + 859 + if (new_screen >= NUM_ITEMS) 860 + new_screen = GO_TO_ROOT; 861 + else if (new_screen == GO_TO_PLUGIN) 858 862 { 859 863 if (global_status.last_screen == GO_TO_SHORTCUTMENU) 860 864 {
+2 -2
apps/settings.h
··· 359 359 int last_frequency; /* Last frequency for resuming, in FREQ_STEP units, 360 360 relative to MIN_FREQ */ 361 361 #endif 362 - signed char last_screen; 362 + int last_screen; 363 363 int viewer_icon_count; 364 364 int last_volume_change; /* tick the last volume change happened. skins use this */ 365 365 int font_id[NB_SCREENS]; /* font id of the settings font for each screen */ 366 366 367 - bool resume_modified; /* playlist is modified (=> warn before erase) */ 367 + int resume_modified; /* playlist is modified (=> warn before erase) */ 368 368 char browse_last_folder[MAX_PATH];/* only saved if keep_directory = true */ 369 369 }; 370 370
+1 -1
apps/settings_list.c
··· 956 956 SYSTEM_STATUS(0, resume_crc32, -1, "CRC"), 957 957 SYSTEM_STATUS(0, resume_elapsed, -1, "ELA"), 958 958 SYSTEM_STATUS(0, resume_offset, -1, "OFF"), 959 - SYSTEM_STATUS(0, resume_modified, false, "PLM"), 959 + SYSTEM_STATUS(0, resume_modified, 0, "PLM"), 960 960 SYSTEM_STATUS(0, runtime, 0, "CRT"), 961 961 SYSTEM_STATUS(0, topruntime, 0, "TRT"), 962 962 SYSTEM_STATUS(0, last_screen, -1, "PVS"),