aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2009-02-10 00:17:46 +0100
committerMax Kellermann <max@duempel.org>2009-02-10 00:17:46 +0100
commit40393ae64f30e685e977617d4738bdfe04cc5786 (patch)
tree37b42f341c147c0bdd70ac77ddbd5154a61723d4
parent2274434e53111a45c1ac90c139fbe84cce0c95a4 (diff)
downloadmpd-40393ae64f30e685e977617d4738bdfe04cc5786.tar.gz
mpd-40393ae64f30e685e977617d4738bdfe04cc5786.tar.xz
mpd-40393ae64f30e685e977617d4738bdfe04cc5786.zip
playlist: update queued song after seeking
If a new song is queued before calling playerSeek(), then the player and the playlist enter an inconsistent state, because the player discards the playlist's "queued" song in favor of the seeked song. Call playlist_update_queued_song() after playerSeek().
-rw-r--r--src/playlist_control.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/src/playlist_control.c b/src/playlist_control.c
index 2d9c180e7..6691df78c 100644
--- a/src/playlist_control.c
+++ b/src/playlist_control.c
@@ -234,11 +234,15 @@ seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time)
queued = NULL;
}
- playlist_update_queued_song(playlist, queued);
-
ret = playerSeek(queue_get_order(&playlist->queue, i), seek_time);
- if (ret < 0)
+ if (ret < 0) {
+ playlist->queued = -1;
+ playlist_update_queued_song(playlist, NULL);
+
return PLAYLIST_RESULT_NOT_PLAYING;
+ }
+
+ playlist_update_queued_song(playlist, queued);
return PLAYLIST_RESULT_SUCCESS;
}