summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: e52f36d)
raw | patch | inline | side by side (parent: e52f36d)
author | Max Kellermann <max@duempel.org> | |
Tue, 23 Aug 2011 16:07:33 +0000 (18:07 +0200) | ||
committer | Max Kellermann <max@duempel.org> | |
Tue, 23 Aug 2011 16:07:33 +0000 (18:07 +0200) |
Use milliseconds instead of float seconds. Reduces overhead.
src/main.c | patch | blob | history | |
src/mpdclient.c | patch | blob | history | |
src/mpdclient.h | patch | blob | history |
diff --git a/src/main.c b/src/main.c
index 25321fc4229a3fbd01ea19bd07f7a1ed09749142..15663df0c9db14facfde74ddd2771319c26ce59e 100644 (file)
--- a/src/main.c
+++ b/src/main.c
mpdclient_disconnect(mpd);
success = mpdclient_connect(mpd,
options.host, options.port,
- 1.5,
+ 1500,
options.password);
if (!success) {
/* try again in 5 seconds */
diff --git a/src/mpdclient.c b/src/mpdclient.c
index 59b0ad45ff504c8c47959e708220747b2b50b907..4882d548f1b21563112626f59bfd7489134d8429 100644 (file)
--- a/src/mpdclient.c
+++ b/src/mpdclient.c
mpdclient_connect(struct mpdclient *c,
const gchar *host,
gint port,
- gfloat _timeout,
+ unsigned timeout_ms,
const gchar *password)
{
/* close any open connection */
mpdclient_disconnect(c);
/* connect to MPD */
- c->connection = mpd_connection_new(host, port, _timeout * 1000);
+ c->connection = mpd_connection_new(host, port, timeout_ms);
if (c->connection == NULL)
g_error("Out of memory");
diff --git a/src/mpdclient.h b/src/mpdclient.h
index 383634fb78398c2e10726ca88d3acc7f03e4cb19..798e979c4d2bbcf73f006282b944627e71c97794 100644 (file)
--- a/src/mpdclient.h
+++ b/src/mpdclient.h
bool
mpdclient_connect(struct mpdclient *c, const gchar *host, gint port,
- gfloat timeout_, const gchar *password);
+ unsigned timeout_ms, const gchar *password);
void
mpdclient_disconnect(struct mpdclient *c);