Playlist: randomize next song when enabling "random" mode while not playing

Don't restore the current song after shufflung when MPD is stopped
(but still remembers the current song internally).  Fixes the first
part of Mantis ticket 0004005.
This commit is contained in:
Max Kellermann 2014-07-11 19:41:39 +02:00
parent 344d10a8e3
commit e2cc328eef
2 changed files with 4 additions and 1 deletions

1
NEWS
View File

@ -6,6 +6,7 @@ ver 0.18.12 (not yet released)
- audiofile: improve responsiveness
- audiofile: fix WAV stream playback
- dsdiff, dsf: fix stream playback
* randomize next song when enabling "random" mode while not playing
ver 0.18.11 (2014/05/12)
* decoder

View File

@ -294,7 +294,9 @@ playlist::SetRandom(PlayerControl &pc, bool status)
if (queue.random) {
/* shuffle the queue order, but preserve current */
const int current_position = GetCurrentPosition();
const int current_position = playing
? GetCurrentPosition()
: -1;
queue.ShuffleOrder();