diff options
author | Eric Wong <normalperson@yhbt.net> | 2008-08-25 20:53:16 -0700 |
---|---|---|
committer | Eric Wong <normalperson@yhbt.net> | 2008-08-25 20:53:16 -0700 |
commit | 4be65a911b6024dc924d1e7d016cab8c42179f71 (patch) | |
tree | c11831a340bde09214d1167fa3b0ff5e7eec0b83 /src | |
parent | 3d15723da3723c08a8cb118cdfbbd238367f0a98 (diff) | |
download | mpd-4be65a911b6024dc924d1e7d016cab8c42179f71.tar.gz mpd-4be65a911b6024dc924d1e7d016cab8c42179f71.tar.xz mpd-4be65a911b6024dc924d1e7d016cab8c42179f71.zip |
playlist: fix "currentsong" after song deletion
When deleting previous songs, we forgot to update the
playlist.queue value, causing syncPlaylistWithQueue to
trigger a false sync and screw with the playlist.current
pointer; causing the currentsong command to return
an incorrect song.
Thanks to unK to reporting this bug!
Diffstat (limited to 'src')
-rw-r--r-- | src/playlist.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/playlist.c b/src/playlist.c index 1c743edc0..4b1042409 100644 --- a/src/playlist.c +++ b/src/playlist.c @@ -824,6 +824,8 @@ int deleteFromPlaylist(int fd, int song) stop_current = 1; if (playlist.current > songOrder) { + if (playlist.current == prev_queued) + playlist.queued = playlist.current - 1; playlist.current--; } else if (playlist.current >= playlist.length) { incrPlaylistCurrent(); |