From fd1144145caaefee0a5c5fdfe18508e0dc2c77cc Mon Sep 17 00:00:00 2001
From: Marc Pavot <m.pavot@gmail.com>
Date: Tue, 25 Nov 2008 16:19:53 +0100
Subject: player: set elapsed=0 at song change

I have found something that looks like a bug in MPD:
- When a song is finished, the next one is played and the 'player'
  event is emitted.
- When the client sends the status command just after this event, the
  songid is the new one but the 'elapsed' time is not reseted to 0.

This is problem because I have implemented the solution using a timer
on client side to compute the elapsed time but with this bug the
elapsed time continues to be incremented on a new song.
---
 src/player_thread.c | 1 +
 1 file changed, 1 insertion(+)

(limited to 'src/player_thread.c')

diff --git a/src/player_thread.c b/src/player_thread.c
index 1595c0af8..7da412dfa 100644
--- a/src/player_thread.c
+++ b/src/player_thread.c
@@ -109,6 +109,7 @@ static int player_wait_for_decoder(struct player *player)
 
 	player->song = pc.next_song;
 	pc.next_song = NULL;
+	pc.elapsed_time = 0;
 	player->queued = false;
 	player->decoder_starting = true;
 
-- 
cgit v1.2.3