From 40393ae64f30e685e977617d4738bdfe04cc5786 Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Tue, 10 Feb 2009 00:17:46 +0100 Subject: 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(). --- src/playlist_control.c | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) (limited to 'src') 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; } -- cgit v1.2.3