From aab6515c52aebd5532ba6d5326196395928d39ba Mon Sep 17 00:00:00 2001 From: Warren Dukes Date: Tue, 2 Nov 2004 02:44:11 +0000 Subject: patches for 0.11.5 bug fix from the following revision changes: 1993 2000 2001 2026 2028 2038 2078 2116 2163 2164 2230 2236 2270 2337 2339 2420 2426 git-svn-id: https://svn.musicpd.org/mpd/branches/branch-0.11.4-fixes@2461 09075e82-0dd4-0310-85a5-a0d7c8717e4f --- src/playlist.c | 21 ++++++++++++++------- 1 file changed, 14 insertions(+), 7 deletions(-) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index 1eba3b7be..3baeb4719 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -167,7 +167,7 @@ void initPlaylist() { memset(playlist.songs,0,sizeof(char *)*playlist_max_length); - srand(time(NULL)); + srandom(time(NULL)); if(getConf()[CONF_STATE_FILE]) { playlist_stateFile = getConf()[CONF_STATE_FILE]; @@ -635,7 +635,7 @@ int addSongToPlaylist(FILE * fp, Song * song) { else */if(playlist.queued>=0) start = playlist.queued+1; else start = playlist.current+1; if(start < playlist.length) { - swap = rand()%(playlist.length-start); + swap = random()%(playlist.length-start); swap+=start; swapOrder(playlist.length-1,swap); } @@ -1129,7 +1129,7 @@ void randomizeOrder(int start,int end) { } for(i=start;i<=end;i++) { - ri = rand()%(end-start+1)+start; + ri = random()%(end-start+1)+start; if(ri==playlist.current) playlist.current = i; else if(i==playlist.current) playlist.current = ri; swapOrder(i,ri); @@ -1220,7 +1220,7 @@ int shufflePlaylist(FILE * fp) { } /* shuffle the rest of the list */ for(;i