playlist: recalculate the queued song after random is toggled

When the random mode is toggled, MPD did not clear the queue.  Because
of this, MPD continued with the next (random or non-random) song
according to the previous mode.  Clear the queued song to fix that.
This commit is contained in:
Max Kellermann
2009-01-23 00:07:10 +01:00
parent 144a91cace
commit 9cad342056
2 changed files with 4 additions and 0 deletions

View File

@@ -951,6 +951,9 @@ void setPlaylistRandomStatus(bool status)
if (status == playlist.queue.random)
return;
if (playlist.queued >= 0)
clearPlayerQueue();
playlist.queue.random = status;
if (playlist.queue.random) {