diff --git a/src/main.c b/src/main.c
index c242da922e97e715ac88a27856f51d04e042c1a9..5b906c513173385869779869c19f07f2b02784f9 100644 (file)
--- a/src/main.c
+++ b/src/main.c
disable_update_timer();
}
-static void
-check_reconnect(void);
-
static void
do_mpd_update(void)
{
screen_update(mpd);
mpd->events = 0;
-
- mpdclient_put_connection(mpd);
- check_reconnect();
}
static char *
g_free(name);
doupdate();
- mpdclient_disconnect(mpd);
- mpdclient_connect(mpd, options.host, options.port,
- options.timeout_ms,
- options.password);
+ mpdclient_connect(mpd);
return FALSE;
}
-static void
-check_reconnect(void)
-{
- if (mpdclient_is_dead(mpd) && reconnect_source_id == 0)
- /* reconnect when the connection is lost */
- reconnect_source_id = g_timeout_add(1000, timer_reconnect,
- NULL);
-}
-
void
mpdclient_connected_callback(void)
{
screen_update(mpd);
mpd->events = 0;
- mpdclient_put_connection(mpd);
- check_reconnect();
auto_update_timer();
}
#endif
/* create mpdclient instance */
- mpd = mpdclient_new();
+ mpd = mpdclient_new(options.host, options.port,
+ options.timeout_ms,
+ options.password);
/* initialize curses */
screen_init(mpd);