summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPřemysl Janouch <p.janouch@gmail.com>2016-10-05 00:13:15 +0200
committerPřemysl Janouch <p.janouch@gmail.com>2016-10-05 00:13:15 +0200
commit319d0faffa9cc4dca6d5e65401e74945930ab096 (patch)
tree07fcf3d0b8352c975aa680d273de9fd6bb439062
parent515d11114bfaee7b6d58441d1d1fa27f9888aef8 (diff)
downloadnncmpp-319d0faffa9cc4dca6d5e65401e74945930ab096.tar.gz
nncmpp-319d0faffa9cc4dca6d5e65401e74945930ab096.tar.xz
nncmpp-319d0faffa9cc4dca6d5e65401e74945930ab096.zip
Don't advance the timer when not playing
Stupid regression.
-rw-r--r--nncmpp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/nncmpp.c b/nncmpp.c
index 4419e25..6991481 100644
--- a/nncmpp.c
+++ b/nncmpp.c
@@ -1623,12 +1623,14 @@ mpd_on_info_response (const struct mpd_response *response,
if (xstrtoul (&tmp, elapsed, 10))
g_ctx.song_elapsed = tmp;
- if (g_ctx.state == PLAYER_PLAYING
- && xstrtoul (&tmp, period, 10))
+ if (xstrtoul (&tmp, period, 10))
msec_past_second = tmp;
}
- poller_timer_set (&g_ctx.elapsed_event, 1000 - msec_past_second);
- g_ctx.elapsed_since = clock_msec (CLOCK_BEST) - msec_past_second;
+ if (g_ctx.state == PLAYER_PLAYING)
+ {
+ poller_timer_set (&g_ctx.elapsed_event, 1000 - msec_past_second);
+ g_ctx.elapsed_since = clock_msec (CLOCK_BEST) - msec_past_second;
+ }
// The server sends -1 when nothing is being played right now
char *volume = str_map_find (&map, "volume");