poll mpd once per second, no need to do it more often

master
Andrzej Rybczak 17 years ago
parent bf71a01b1c
commit ffbcfb7e18
  1. 2
      src/ncmpcpp.h
  2. 4
      src/status.cpp

@ -31,7 +31,7 @@ using namespace NCurses;
typedef std::pair<std::string, std::string> string_pair;
const int ncmpcpp_window_timeout = 500;
const int ncmpcpp_window_timeout = 250;
const std::string home_folder = getenv("HOME") ? getenv("HOME") : "";

@ -106,9 +106,7 @@ void TraceMpdStatus()
static timeval past, now;
gettimeofday(&now, 0);
if (Mpd->Connected()
&& ((now.tv_sec == past.tv_sec && now.tv_usec >= past.tv_usec+500000) || now.tv_sec > past.tv_sec)
)
if (Mpd->Connected() && now.tv_sec > past.tv_sec)
{
Mpd->UpdateStatus();
gettimeofday(&past, 0);

Loading…
Cancel
Save