diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-09-07 13:48:21 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-09-07 13:48:21 -0700 |
commit | 5881a3a65d3ff6ae29c3e10752827574c4c5b100 (patch) | |
tree | 37c9ce0dd6cd1535ab9741a655421b4ba290ee43 | |
parent | 28de5feab5392f0989633981c91e3131ca83427d (diff) | |
download | mpd-5881a3a65d3ff6ae29c3e10752827574c4c5b100.tar.gz mpd-5881a3a65d3ff6ae29c3e10752827574c4c5b100.tar.xz mpd-5881a3a65d3ff6ae29c3e10752827574c4c5b100.zip |
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 <song_a>
next => <song_b>
next => <song_c>
next => <song_d>
play <song_a>
next => <song_b>
next => <song_c>
next => <song_d>
...
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
-rw-r--r-- | src/playlist.c | 1 |
1 files changed, 1 insertions, 0 deletions
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); } } |