aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWeng Xuetian <wengxt@gmail.com>2014-04-09 23:10:14 +0200
committerMax Kellermann <max@duempel.org>2014-04-09 23:10:14 +0200
commit3a4e667078e13f27b3d196d3b3a56f1f39be2c75 (patch)
treefac70e09e0638e503d46d4d318504c042304e0ac /src
parentce18c36ed9328b4b5d376562594d8acb13a6723d (diff)
downloadmpd-3a4e667078e13f27b3d196d3b3a56f1f39be2c75.tar.gz
mpd-3a4e667078e13f27b3d196d3b3a56f1f39be2c75.tar.xz
mpd-3a4e667078e13f27b3d196d3b3a56f1f39be2c75.zip
PlaylistEdit: don't interrupt playback when current song gets deleted
Diffstat (limited to '')
-rw-r--r--src/PlaylistEdit.cxx18
1 files changed, 8 insertions, 10 deletions
diff --git a/src/PlaylistEdit.cxx b/src/PlaylistEdit.cxx
index 668612a1a..3eea2491e 100644
--- a/src/PlaylistEdit.cxx
+++ b/src/PlaylistEdit.cxx
@@ -234,12 +234,8 @@ playlist::DeleteInternal(PlayerControl &pc,
if (playing && current == (int)songOrder) {
const bool paused = pc.GetState() == PlayerState::PAUSE;
- /* the current song is going to be deleted: stop the player */
-
- pc.Stop();
- playing = false;
-
- /* see which song is going to be played instead */
+ /* the current song is going to be deleted: see which
+ song is going to be played instead */
current = queue.GetNextOrder(current);
if (current == (int)songOrder)
@@ -248,10 +244,12 @@ playlist::DeleteInternal(PlayerControl &pc,
if (current >= 0 && !paused)
/* play the song after the deleted one */
PlayOrder(pc, current);
- else
- /* no songs left to play, stop playback
- completely */
- Stop(pc);
+ else {
+ /* stop the player */
+
+ pc.Stop();
+ playing = false;
+ }
*queued_p = nullptr;
} else if (current == (int)songOrder)