playlist: don't unpause on delete

When you delete a song from the playlist which was paused, MPD forgot
that it was paused and started playing the next song.
This commit is contained in:
Max Kellermann
2009-01-23 16:17:21 +01:00
parent 032640f9e5
commit 276843edd5
2 changed files with 4 additions and 1 deletions

View File

@@ -647,6 +647,8 @@ enum playlist_result deleteFromPlaylist(unsigned song)
clearPlayerQueue();
if (playlist.playing && playlist.current == (int)songOrder) {
bool paused = getPlayerState() == PLAYER_STATE_PAUSE;
/* the current song is going to be deleted: stop the player */
playerWait();
@@ -658,7 +660,7 @@ enum playlist_result deleteFromPlaylist(unsigned song)
if (playlist.current == (int)songOrder)
playlist.current = -1;
if (playlist.current >= 0)
if (playlist.current >= 0 && !paused)
/* play the song after the deleted one */
playPlaylistOrderNumber(playlist.current);
else