diff options
author | Hardeep Sidhu <dyp@pobox.com> | 2006-09-15 23:51:21 +0000 |
---|---|---|
committer | Hardeep Sidhu <dyp@pobox.com> | 2006-09-15 23:51:21 +0000 |
commit | 8fe4507dc76e6f5b5fa764bb307241d5d0af5d1b (patch) | |
tree | 48fbd13e1b1ddb7246d85a642e3fec7334db004c | |
parent | 16c55277f7b3580f42f7345d4ef2919b98ae6cda (diff) | |
download | rockbox-8fe4507dc76e6f5b5fa764bb307241d5d0af5d1b.tar.gz rockbox-8fe4507dc76e6f5b5fa764bb307241d5d0af5d1b.zip |
Always set random seed before inserting tracks shuffled. Fixes problem with shuffle always being the same when inserting immediately after startup.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10956 a1c6a512-1295-4272-9138-f99709370657
-rw-r--r-- | apps/onplay.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/apps/onplay.c b/apps/onplay.c index 106c433d60..7aa74d36ac 100644 --- a/apps/onplay.c +++ b/apps/onplay.c | |||
@@ -177,6 +177,10 @@ static bool add_to_playlist(int position, bool queue) | |||
177 | if (new_playlist) | 177 | if (new_playlist) |
178 | playlist_create(NULL, NULL); | 178 | playlist_create(NULL, NULL); |
179 | 179 | ||
180 | /* always set seed before inserting shuffled */ | ||
181 | if (position == PLAYLIST_INSERT_SHUFFLED) | ||
182 | srand(current_tick); | ||
183 | |||
180 | if (context == CONTEXT_ID3DB) | 184 | if (context == CONTEXT_ID3DB) |
181 | { | 185 | { |
182 | tagtree_insert_selection_playlist(position, queue); | 186 | tagtree_insert_selection_playlist(position, queue); |