Code

main: remove check_reconnect()
authorMax Kellermann <max.kellermann@gmail.com>
Sun, 19 Mar 2017 11:49:42 +0000 (12:49 +0100)
committerMax Kellermann <max.kellermann@gmail.com>
Sun, 19 Mar 2017 12:04:10 +0000 (13:04 +0100)
Assume that mpdclient_lost_callback() is everything we need to
implement.

src/main.c

index 8ade659e69ddc0f997fa2bfe46a74a6754568998..5b906c513173385869779869c19f07f2b02784f9 100644 (file)
@@ -130,9 +130,6 @@ auto_update_timer(void)
                disable_update_timer();
 }
 
-static void
-check_reconnect(void);
-
 static void
 do_mpd_update(void)
 {
@@ -147,8 +144,6 @@ do_mpd_update(void)
 
        screen_update(mpd);
        mpd->events = 0;
-
-       check_reconnect();
 }
 
 static char *
@@ -205,15 +200,6 @@ timer_reconnect(gcc_unused gpointer data)
        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)
 {
@@ -307,7 +293,6 @@ void end_input_event(void)
        screen_update(mpd);
        mpd->events = 0;
 
-       check_reconnect();
        auto_update_timer();
 }