From e2cc328eef4d7c19a6bc7755779babe88ff51105 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Fri, 11 Jul 2014 19:41:39 +0200 Subject: 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. --- src/Playlist.cxx | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'src') diff --git a/src/Playlist.cxx b/src/Playlist.cxx index 8d9ab24a3..ac2cc494b 100644 --- a/src/Playlist.cxx +++ b/src/Playlist.cxx @@ -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(); -- cgit v1.2.3