diff options
Diffstat (limited to 'apps/playlist.c')
-rw-r--r-- | apps/playlist.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 2d8bbd3a33..c74d643c52 100644 --- a/apps/playlist.c +++ b/apps/playlist.c | |||
@@ -205,20 +205,6 @@ void add_indices_to_playlist( playlist_info_t *playlist ) | |||
205 | close(fd); | 205 | close(fd); |
206 | } | 206 | } |
207 | 207 | ||
208 | static unsigned int playlist_seed = 0xdeadcafe; | ||
209 | static void seedit(unsigned int seed) | ||
210 | { | ||
211 | playlist_seed = seed; | ||
212 | } | ||
213 | |||
214 | static int getrand(void) | ||
215 | { | ||
216 | playlist_seed += 0x12345; | ||
217 | |||
218 | /* the rand is from 0 to RAND_MAX */ | ||
219 | return playlist_seed; | ||
220 | } | ||
221 | |||
222 | /* | 208 | /* |
223 | * randomly rearrange the array of indices for the playlist | 209 | * randomly rearrange the array of indices for the playlist |
224 | */ | 210 | */ |
@@ -229,14 +215,14 @@ void randomise_playlist( playlist_info_t *playlist, unsigned int seed ) | |||
229 | int store; | 215 | int store; |
230 | 216 | ||
231 | /* seed with the given seed */ | 217 | /* seed with the given seed */ |
232 | seedit( seed ); | 218 | srand( seed ); |
233 | 219 | ||
234 | /* randomise entire indices list */ | 220 | /* randomise entire indices list */ |
235 | 221 | ||
236 | while( count < playlist->amount ) | 222 | while( count < playlist->amount ) |
237 | { | 223 | { |
238 | /* the rand is from 0 to RAND_MAX, so adjust to our value range */ | 224 | /* the rand is from 0 to RAND_MAX, so adjust to our value range */ |
239 | candidate = getrand() % ( playlist->amount ); | 225 | candidate = rand() % playlist->amount; |
240 | 226 | ||
241 | /* now swap the values at the 'count' and 'candidate' positions */ | 227 | /* now swap the values at the 'count' and 'candidate' positions */ |
242 | store = playlist->indices[candidate]; | 228 | store = playlist->indices[candidate]; |