aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorWarren Dukes <warren.dukes@gmail.com>2007-02-18 00:06:20 +0000
committerWarren Dukes <warren.dukes@gmail.com>2007-02-18 00:06:20 +0000
commitd7e8507eaf9ac76d207a51ac850964b9373ba2d3 (patch)
treefbf1dbc6d813e8b89191af583e9d51707d59e202 /src
parent81fd135651d4235927af32bfa2a420017dca23ce (diff)
downloadmpd-d7e8507eaf9ac76d207a51ac850964b9373ba2d3.tar.gz
mpd-d7e8507eaf9ac76d207a51ac850964b9373ba2d3.tar.xz
mpd-d7e8507eaf9ac76d207a51ac850964b9373ba2d3.zip
fix for bug #1447
git-svn-id: https://svn.musicpd.org/mpd/trunk@5369 09075e82-0dd4-0310-85a5-a0d7c8717e4f
Diffstat (limited to '')
-rw-r--r--src/playlist.c26
1 files changed, 20 insertions, 6 deletions
diff --git a/src/playlist.c b/src/playlist.c
index b14747fc8..8f4b17804 100644
--- a/src/playlist.c
+++ b/src/playlist.c
@@ -1194,12 +1194,26 @@ int moveSongInPlaylist(int fd, int from, int to)
playlist.order[i] = to;
}
}
- } else if (playlist.current == from)
- playlist.current = to;
- else if (playlist.current > from && playlist.current <= to) {
- playlist.current--;
- } else if (playlist.current >= to && playlist.current < from) {
- playlist.current++;
+ }
+ else
+ {
+ if (playlist.current == from)
+ playlist.current = to;
+ else if (playlist.current > from && playlist.current <= to) {
+ playlist.current--;
+ } else if (playlist.current >= to && playlist.current < from) {
+ playlist.current++;
+ }
+
+ /* this first if statement isn't necessary since the queue
+ * would have been cleared out if queued == from */
+ if (playlist.queued == from)
+ playlist.queued = to;
+ else if (playlist.queued > from && playlist.queued <= to) {
+ playlist.queued--;
+ } else if (playlist.queued>= to && playlist.queued < from) {
+ playlist.queued++;
+ }
}
incrPlaylistVersion();