diff options
author | Max Kellermann <max@duempel.org> | 2014-07-11 21:33:50 +0200 |
---|---|---|
committer | Max Kellermann <max@duempel.org> | 2014-07-11 21:33:50 +0200 |
commit | 828cd6fd0b8838edb39e6b3f62397a5fe369e1d5 (patch) | |
tree | 62bfa8fdaaf846a5a4c18e6607ef8f1e8f13c8a2 /src/queue/Playlist.cxx | |
parent | 681643ea9e6e196c449f1974cd50e1f400da3450 (diff) | |
parent | ecb67a1ed16e93f5fe552b28631e517060115648 (diff) | |
download | mpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.tar.gz mpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.tar.xz mpd-828cd6fd0b8838edb39e6b3f62397a5fe369e1d5.zip |
Merge branch 'v0.18.x'
Diffstat (limited to 'src/queue/Playlist.cxx')
-rw-r--r-- | src/queue/Playlist.cxx | 10 |
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(); |