summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJonathan Gordon <rockbox@jdgordon.info>2008-09-20 15:30:55 +0000
committerJonathan Gordon <rockbox@jdgordon.info>2008-09-20 15:30:55 +0000
commit40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212 (patch)
treeb190ac5d9963bb9e2695eef107970158cc32258a
parent3d5fba986578195129c7bf7f2449081c98f5845c (diff)
downloadrockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.zip
rockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.tar.gz
rockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.tar.bz2
rockbox-40d713c5fc8ee1b9127fc81ce4bb97a50e2a4212.tar.xz
FS#9408 - dont bother saving the random seed in global status. I'm 99.9% sure this code was being ignored anyway.
If this commit causes problems with restarting playback open a bug report (getting testers was difficult...) Settings which are stored in the nvram.bin file will be reset with this commit. this includes resume info, runtimes, "last screen" and a few others. git-svn-id: svn://svn.rockbox.org/rockbox/trunk@18555 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r--apps/playlist.c33
-rw-r--r--apps/settings.h2
-rw-r--r--apps/settings_list.c1
-rw-r--r--apps/settings_list.h2
4 files changed, 1 insertions, 37 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 9c49477..1d42ba3 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -300,7 +300,6 @@ static void empty_playlist(struct playlist_info* playlist, bool resume)
/* Reset resume settings */
global_status.resume_first_index = 0;
- global_status.resume_seed = -1;
}
}
@@ -443,12 +442,6 @@ static int recreate_control(struct playlist_info* playlist)
playlist->deleted = false;
playlist->num_inserted_tracks = 0;
- if (playlist->current)
- {
- global_status.resume_seed = -1;
- status_save();
- }
-
for (i=0; i<playlist->amount; i++)
{
if (playlist->indices[i] & PLAYLIST_INSERT_TYPE_MASK)
@@ -989,8 +982,6 @@ static int randomise_playlist(struct playlist_info* playlist,
{
update_control(playlist, PLAYLIST_COMMAND_SHUFFLE, seed,
playlist->first_index, NULL, NULL, NULL);
- global_status.resume_seed = seed;
- status_save();
}
return 0;
@@ -1029,8 +1020,6 @@ static int sort_playlist(struct playlist_info* playlist, bool start_current,
{
update_control(playlist, PLAYLIST_COMMAND_UNSHUFFLE,
playlist->first_index, -1, NULL, NULL, NULL);
- global_status.resume_seed = 0;
- status_save();
}
return 0;
@@ -1819,12 +1808,6 @@ static int flush_cached_control(struct playlist_info* playlist)
if (result > 0)
{
- if (global_status.resume_seed >= 0)
- {
- global_status.resume_seed = -1;
- status_save();
- }
-
playlist->num_cached = 0;
playlist->pending_control_sync = true;
@@ -2207,7 +2190,6 @@ int playlist_resume(void)
if (randomise_playlist(playlist, seed, false,
false) < 0)
return -1;
-
sorted = false;
break;
}
@@ -2372,21 +2354,6 @@ int playlist_resume(void)
/* Terminate on EOF */
if(nread <= 0)
{
- if (global_status.resume_seed >= 0)
- {
- /* Apply shuffle command saved in settings */
- if (global_status.resume_seed == 0)
- sort_playlist(playlist, false, true);
- else
- {
- if (!sorted)
- sort_playlist(playlist, false, false);
-
- randomise_playlist(playlist, global_status.resume_seed,
- false, true);
- }
- }
-
playlist->first_index = global_status.resume_first_index;
break;
}
diff --git a/apps/settings.h b/apps/settings.h
index 9ef8323..855072a 100644
--- a/apps/settings.h
+++ b/apps/settings.h
@@ -271,8 +271,6 @@ struct system_status
int resume_index; /* index in playlist (-1 for no active resume) */
int resume_first_index; /* index of first track in playlist */
uint32_t resume_offset; /* byte offset in mp3 file */
- int resume_seed; /* shuffle seed (-1=no resume shuffle 0=sorted
- >0=shuffled) */
int runtime; /* current runtime since last charge */
int topruntime; /* top known runtime */
#ifdef HAVE_DIRCACHE
diff --git a/apps/settings_list.c b/apps/settings_list.c
index 0addf5c..f94338c 100644
--- a/apps/settings_list.c
+++ b/apps/settings_list.c
@@ -427,7 +427,6 @@ const struct settings_list settings[] = {
SYSTEM_SETTING(NVRAM(4), resume_index, -1),
SYSTEM_SETTING(NVRAM(4), resume_first_index, 0),
SYSTEM_SETTING(NVRAM(4), resume_offset, -1),
- SYSTEM_SETTING(NVRAM(4), resume_seed, -1),
CHOICE_SETTING(0, repeat_mode, LANG_REPEAT, REPEAT_ALL, "repeat",
"off,all,one,shuffle"
#ifdef AB_REPEAT_ENABLE
diff --git a/apps/settings_list.h b/apps/settings_list.h
index f8ce4fd..7d0f750 100644
--- a/apps/settings_list.h
+++ b/apps/settings_list.h
@@ -111,7 +111,7 @@ struct table_setting {
#define F_NVRAM_BYTES_MASK 0xE0000 /*0-4 bytes can be stored */
#define F_NVRAM_MASK_SHIFT 17
-#define NVRAM_CONFIG_VERSION 4
+#define NVRAM_CONFIG_VERSION 5
/* Above define should be bumped if
- a new NVRAM setting is added between 2 other NVRAM settings
- number of bytes for a NVRAM setting is changed