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().
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
Reference in New Issue
Block a user