From d2d716fd3533db2410362a0831c354d7cb9f6bb7 Mon Sep 17 00:00:00 2001 From: Andrzej Rybczak Date: Sun, 6 Dec 2009 01:21:53 +0100 Subject: [PATCH] fix updating bitrate of current song --- src/status.cpp | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/src/status.cpp b/src/status.cpp index bd818449..e784ddb5 100644 --- a/src/status.cpp +++ b/src/status.cpp @@ -134,7 +134,18 @@ void TraceMpdStatus() BlockItemListUpdate = 0; Playlist::BlockUpdate = 0; UpdateStatusImmediately = 0; - gettimeofday(&past, 0); + if (!Mpd.SupportsIdle()) + { + gettimeofday(&past, 0); + } + else if (Config.display_bitrate && Global::Timer.tv_sec > past.tv_sec && Mpd.isPlaying()) + { + // ncmpcpp doesn't fetch status constantly if mpd supports + // idle mode so current song's bitrate is never updated. + // we need to force ncmpcpp to fetch it. + Mpd.OrderDataFetching(); + gettimeofday(&past, 0); + } } myScreen->Update();