aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMaarten Sebregts <maartensebregts@gmail.com>2011-12-19 21:15:00 +0100
committerMax Kellermann <max@duempel.org>2011-12-21 10:29:07 +0100
commit3a9697adf268d780500cc53432efa4f164db7bb4 (patch)
treef3bb124f2d75f3abc4ed2fac9845ca7d09a7c187
parent96ad5b84446be0bf603895adaf0ec2e97bee11aa (diff)
downloadmpd-3a9697adf268d780500cc53432efa4f164db7bb4.tar.gz
mpd-3a9697adf268d780500cc53432efa4f164db7bb4.tar.xz
mpd-3a9697adf268d780500cc53432efa4f164db7bb4.zip
Playlist: fix bug in moving after current song
Moving songs using either 'move' or 'moveid' to position -1 (after the current song) would fail for a song which is just before the current song. This patch corrects the check to see if the current song is in the range to be moved. Since the range is from `start` up to `end` (exclusive) the check was incorrect, but is now fixed.
Diffstat (limited to '')
-rw-r--r--NEWS1
-rw-r--r--src/playlist_edit.c2
2 files changed, 2 insertions, 1 deletions
diff --git a/NEWS b/NEWS
index bc229304a..acbc242d3 100644
--- a/NEWS
+++ b/NEWS
@@ -2,6 +2,7 @@ ver 0.16.7 (2011/??/??)
* output:
- httpd: fix excessive buffering
- openal: force 16 bit playback, as 8 bit doesn't work
+* fix moving after current song
ver 0.16.6 (2011/12/01)
diff --git a/src/playlist_edit.c b/src/playlist_edit.c
index c54b72750..3bcb2ce14 100644
--- a/src/playlist_edit.c
+++ b/src/playlist_edit.c
@@ -356,7 +356,7 @@ playlist_move_range(struct playlist *playlist,
playlist->current)
: -1;
if (to < 0 && playlist->current >= 0) {
- if (start <= (unsigned)currentSong && (unsigned)currentSong <= end)
+ if (start <= (unsigned)currentSong && (unsigned)currentSong < end)
/* no-op, can't be moved to offset of itself */
return PLAYLIST_RESULT_SUCCESS;
to = (currentSong + abs(to)) % queue_length(&playlist->queue);