From 9374e0f4454ff5a37f70ce2d6110d5612856a169 Mon Sep 17 00:00:00 2001
From: Max Kellermann <max@duempel.org>
Date: Wed, 15 Aug 2012 22:51:48 +0200
Subject: [PATCH] player_thread: add local variable "start_ms"

Just in case "song" becomes invalid at some point.
---
 src/player_thread.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

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;