aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMax Kellermann <max@duempel.org>2008-10-03 15:35:58 +0200
committerMax Kellermann <max@duempel.org>2008-10-03 15:35:58 +0200
commitc85a3c8f1d28929bb18afc72ec3abd3dd9ed4b7c (patch)
tree4736087f6fca9a986481f34c0d02838c0fb205cf
parent466530d2506d7bcea3d2d546a471bf51b78f85e7 (diff)
downloadmpd-c85a3c8f1d28929bb18afc72ec3abd3dd9ed4b7c.tar.gz
mpd-c85a3c8f1d28929bb18afc72ec3abd3dd9ed4b7c.tar.xz
mpd-c85a3c8f1d28929bb18afc72ec3abd3dd9ed4b7c.zip
store MPD_UPDATE_TIME as guint
The glib function g_timeout_add() wants the interval as guint in milliseconds. Store the update interval in this form, instead of having to multiply MPD_UPDATE_TIME with 1000.
-rw-r--r--src/main.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main.c b/src/main.c
index 5c2d0e52c..da9f55389 100644
--- a/src/main.c
+++ b/src/main.c
@@ -40,7 +40,7 @@
#include <string.h>
/* time between mpd updates [s] */
-static const float MPD_UPDATE_TIME = 0.5;
+static const guint update_interval = 500;
#define BUFSIZE 1024
@@ -284,7 +284,7 @@ keyboard_event(mpd_unused GIOChannel *source,
if (cmd == CMD_VOLUME_UP || cmd == CMD_VOLUME_DOWN) {
/* make sure we dont update the volume yet */
g_source_remove(update_source_id);
- update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000),
+ update_source_id = g_timeout_add(update_interval,
timer_mpd_update,
GINT_TO_POINTER(TRUE));
}
@@ -433,7 +433,7 @@ main(int argc, const char *argv[])
/* attempt to connect */
reconnect_source_id = g_timeout_add(1, timer_reconnect, NULL);
- update_source_id = g_timeout_add((guint)(MPD_UPDATE_TIME * 1000),
+ update_source_id = g_timeout_add(update_interval,
timer_mpd_update,
GINT_TO_POINTER(TRUE));
g_timeout_add(10000, timer_check_key_bindings, NULL);