From 3e24665c417c2dd7dc292c9f12efae4e6544aa11 Mon Sep 17 00:00:00 2001 From: Jonathan Gordon Date: Wed, 6 Dec 2006 12:11:57 +0000 Subject: Fix settings not saving to disk correctly, (fixes FS#6408) Stop playback.c requesting a rebuffer while not playing Shutting down from inside the menu will now save settings to disk, and entering the main menu will not force a setting save unless a setting actually changes git-svn-id: svn://svn.rockbox.org/rockbox/trunk@11674 a1c6a512-1295-4272-9138-f99709370657 --- apps/main.c | 1 + apps/main_menu.c | 1 - apps/playback.c | 2 +- apps/settings.c | 8 ++++++++ 4 files changed, 10 insertions(+), 2 deletions(-) (limited to 'apps') diff --git a/apps/main.c b/apps/main.c index 753cd71e8d..bfc331dc88 100644 --- a/apps/main.c +++ b/apps/main.c @@ -162,6 +162,7 @@ int init_dircache(bool preinit) { backlight_on(); show_logo(); + settings_save(); } } diff --git a/apps/main_menu.c b/apps/main_menu.c index 0ac4d94753..f66f511e9c 100644 --- a/apps/main_menu.c +++ b/apps/main_menu.c @@ -435,7 +435,6 @@ bool main_menu(void) #endif menu_exit(m); - settings_save(); return result; } diff --git a/apps/playback.c b/apps/playback.c index 02af5b6ec4..294bb3d69c 100644 --- a/apps/playback.c +++ b/apps/playback.c @@ -3560,7 +3560,7 @@ static void audio_thread(void) else { queue_wait_w_tmo(&audio_queue, &ev, HZ/2); - if ( (ev.id == SYS_TIMEOUT) && + if (playing && (ev.id == SYS_TIMEOUT) && (FILEBUFUSED < high_watermark)) register_ata_idle_func(ata_fillbuffer_callback); } diff --git a/apps/settings.c b/apps/settings.c index 94d456fcf5..91ffc0d238 100644 --- a/apps/settings.c +++ b/apps/settings.c @@ -2086,6 +2086,14 @@ bool do_set_setting(const unsigned char* string, void *variable, if ( function ) function(type_fromvoidptr(cb_data->type,variable)); } + if (cb_data->type == INT) + { + if (oldvalue != *(int*)variable) + settings_save(); + } + else if (oldvalue != *(bool*)variable) + settings_save(); + return false; } bool set_int(const unsigned char* string, -- cgit v1.2.3