From 5881a3a65d3ff6ae29c3e10752827574c4c5b100 Mon Sep 17 00:00:00 2001 From: Eric Wong Date: Sun, 7 Sep 2008 13:48:21 -0700 Subject: playlist: re-randomize when explicitly playing a new song When random is enabled and a user explicitly specifies a certain song on the playlist should be played; we need to re-randomize the internal ordering. To reproduce this, assuming a four song playlist: play next => next => next => play next => next => next => ... That is, the "next" command restarts song_{b,c,d} the second time "play" starts playing song_a. Thus, the second time "play" is called, the ordering of song_{b,c,d} needs to be reshuffled. Reported-by: Qball --- src/playlist.c | 1 + 1 file changed, 1 insertion(+) (limited to 'src/playlist.c') diff --git a/src/playlist.c b/src/playlist.c index 9546dee70..89b4fdd99 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -945,6 +945,7 @@ int playPlaylist(int fd, int song, int stopOnError) playlist.current = 0; swapOrder(i, playlist.current); i = playlist.current; + randomizeOrder(i + 1, playlist.length - 1); } } -- cgit v1.2.3