diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.c | 10 | ||||
-rw-r--r-- | src/mpc.c | 2 | ||||
-rw-r--r-- | src/ncmpc.h | 4 |
3 files changed, 9 insertions, 7 deletions
diff --git a/src/main.c b/src/main.c index 176bcf8a0..7a44f0985 100644 --- a/src/main.c +++ b/src/main.c @@ -1,7 +1,7 @@ /* * $Id$ * - * (c) 2004 by Kalle Wallin (kaw@linux.se) + * (c) 2004 by Kalle Wallin <kaw@linux.se> * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by @@ -168,6 +168,7 @@ main(int argc, const char *argv[]) } else mpd_finishCommand(mpc->connection); + g_timer_start(timer); } @@ -188,9 +189,10 @@ main(int argc, const char *argv[]) } else if( options->reconnect ) { - sleep(MPD_RECONNECT_TIMEOUT); - screen_status_printf(_("Connecting to %s... [Press Ctrl-C to abort]"), - options->host); + if( get_keyboard_command_with_timeout(MPD_RECONNECT_TIME)==CMD_QUIT) + exit(EXIT_SUCCESS); + screen_status_printf(_("Connecting to %s... [Press %s to abort]"), + options->host, get_key_names(CMD_QUIT,0) ); if( mpc_reconnect(mpc, options->host, options->port, @@ -77,7 +77,7 @@ mpc_reconnect(mpd_client_t *c, char *host, int port, char *password) { mpd_Connection *connection; - connection = mpd_newConnection(host, port, 10); + connection = mpd_newConnection(host, port, 1); if( connection==NULL ) return -1; if( connection->error ) diff --git a/src/ncmpc.h b/src/ncmpc.h index 2708aac50..93e48d541 100644 --- a/src/ncmpc.h +++ b/src/ncmpc.h @@ -32,8 +32,8 @@ /* time in seconds between mpd updates (double) */ #define MPD_UPDATE_TIME 0.5 -/* timout in seconds before trying to reconnect (int) */ -#define MPD_RECONNECT_TIMEOUT 3 +/* time in milliseconds before trying to reconnect (int) */ +#define MPD_RECONNECT_TIME 1000 #endif /* NCMPC_H */ |