aboutsummaryrefslogtreecommitdiffstats
path: root/src/queue/Playlist.cxx
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2014-07-11 21:33:50 +0200
committerMax Kellermann <max@duempel.org>2014-07-11 21:33:50 +0200
commit828cd6fd0b8838edb39e6b3f62397a5fe369e1d5 (patch)
tree62bfa8fdaaf846a5a4c18e6607ef8f1e8f13c8a2 /src/queue/Playlist.cxx
parent681643ea9e6e196c449f1974cd50e1f400da3450 (diff)
parentecb67a1ed16e93f5fe552b28631e517060115648 (diff)
downloadmpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.tar.gz
mpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.tar.xz
mpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.zip
Merge branch 'v0.18.x'
Diffstat (limited to '')
-rw-r--r--src/queue/Playlist.cxx10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/queue/Playlist.cxx b/src/queue/Playlist.cxx
index abcb2ceaa..b2fd673b4 100644
--- a/src/queue/Playlist.cxx
+++ b/src/queue/Playlist.cxx
@@ -99,6 +99,12 @@ playlist::UpdateQueuedSong(PlayerControl &pc, const DetachedSong *prev)
if (!playing)
return;
+ if (prev == nullptr && bulk_edit)
+ /* postponed until CommitBulk() to avoid always
+ queueing the first song that is being added (in
+ random mode) */
+ return;
+
assert(!queue.IsEmpty());
assert((queued < 0) == (prev == nullptr));
@@ -286,7 +292,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();