aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2012-08-15 22:51:48 +0200
committerMax Kellermann <max@duempel.org>2012-08-15 22:51:48 +0200
commit9374e0f4454ff5a37f70ce2d6110d5612856a169 (patch)
tree5d4dadf7c45032fa987f4ce40b11e7ea3c820093
parent19ed233118bf2d3af07103dc80ceb6f5a3466b00 (diff)
downloadmpd-9374e0f4454ff5a37f70ce2d6110d5612856a169.tar.gz
mpd-9374e0f4454ff5a37f70ce2d6110d5612856a169.tar.xz
mpd-9374e0f4454ff5a37f70ce2d6110d5612856a169.zip
player_thread: add local variable "start_ms"
Just in case "song" becomes invalid at some point.
-rw-r--r--src/player_thread.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/player_thread.c b/src/player_thread.c
index c0243fa00..eaf6df303 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -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;