Commit 9374e0f4 authored by Max Kellermann's avatar Max Kellermann

player_thread: add local variable "start_ms"

Just in case "song" becomes invalid at some point.
parent 19ed2331
......@@ -450,6 +450,8 @@ static bool player_seek_decoder(struct player *player)
assert(pc->next_song != NULL);
const unsigned start_ms = song->start_ms;
if (decoder_current_song(dc) != song) {
/* the decoder is already decoding the "next" song -
stop it and start the previous song again */
......@@ -498,7 +500,7 @@ static bool player_seek_decoder(struct player *player)
if (where < 0.0)
where = 0.0;
if (!dc_seek(dc, where + song->start_ms / 1000.0)) {
if (!dc_seek(dc, where + start_ms / 1000.0)) {
/* decoder failure */
player_command_finished(pc);
return false;
......
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