summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: 71c696c)
raw | patch | inline | side by side (parent: 71c696c)
author | Max Kellermann <max@duempel.org> | |
Sun, 4 Oct 2009 16:24:00 +0000 (18:24 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Sun, 4 Oct 2009 16:24:00 +0000 (18:24 +0200) |
When the "update timer" is running because the clock is enabled, don't
call mpdclient_update() in each tick. For the clock, it's enough to
update MPD only when an idle event occurs. While MPD is playing, we
still need MPD updates, beacuse we need the new "elapsed" time.
call mpdclient_update() in each tick. For the clock, it's enough to
update MPD only when an idle event occurs. While MPD is playing, we
still need MPD updates, beacuse we need the new "elapsed" time.
src/main.c | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 2bc1b624e70767c330bfbaf014d539e2152d97cd..34fa355379c8677ccf6f9ed8f66cd302cdafec0d 100644 (file)
--- a/src/main.c
+++ b/src/main.c
static void
do_mpd_update(void)
{
- if (mpdclient_is_connected(mpd))
+ if (mpdclient_is_connected(mpd) &&
+ (mpd->source == NULL || mpd->events != 0 ||
+ (mpd->status != NULL &&
+ mpd_status_get_state(mpd->status) == MPD_STATE_PLAY)))
mpdclient_update(mpd);
#ifndef NCMPC_MINI