Commit 40393ae6 authored by Max Kellermann's avatar Max Kellermann

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().
parent 2274434e
...@@ -234,11 +234,15 @@ seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time) ...@@ -234,11 +234,15 @@ seekSongInPlaylist(struct playlist *playlist, unsigned song, float seek_time)
queued = NULL; queued = NULL;
} }
playlist_update_queued_song(playlist, queued);
ret = playerSeek(queue_get_order(&playlist->queue, i), seek_time); 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; return PLAYLIST_RESULT_NOT_PLAYING;
}
playlist_update_queued_song(playlist, queued);
return PLAYLIST_RESULT_SUCCESS; return PLAYLIST_RESULT_SUCCESS;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment