player_thread: add local variable "start_ms"
Just in case "song" becomes invalid at some point.
This commit is contained in:
parent
19ed233118
commit
9374e0f445
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user