Changeset 863
- Timestamp:
- 03/05/08 22:41:25 (9 months ago)
- Files:
-
- 1 modified
-
trunk/plugin_mpd.c (modified) (6 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/plugin_mpd.c
r862 r863 2 2 * $URL$ 3 3 * 4 * mpd informations v0.8 14 * mpd informations v0.82 5 5 * 6 6 * Copyright (C) 2006 Stefan Kuhne <sk-privat@gmx.net> … … 94 94 95 95 #define TIMEOUT_IN_S 10 96 #define ERROR_DISPLAY 5 96 97 97 98 /* current song */ … … 126 127 static mpd_Connection *conn; 127 128 static char Section[] = "Plugin:MPD"; 128 129 static int errorcnt = 0; 129 130 130 131 … … 207 208 if (conn == NULL || conn->error) { 208 209 if (conn) { 209 debug("[MPD] Error: [%s], try to reconnect to [%s]:[%i]\n", conn->errorStr, host, iport); 210 if (errorcnt < ERROR_DISPLAY) 211 debug("[MPD] Error: [%s], try to reconnect to [%s]:[%i]\n", conn->errorStr, host, iport); 210 212 mpd_closeConnection(conn); 211 213 } else … … 213 215 214 216 conn = mpd_newConnection(host, iport, TIMEOUT_IN_S); 215 if (conn->error) { 216 error("[MPD] connection failed, give up..."); 217 if (conn->error) { 218 if (errorcnt < ERROR_DISPLAY) 219 error("[MPD] connection failed, give up..."); 220 if (errorcnt == ERROR_DISPLAY) 221 error("[MPD] stop logging, until connection is fixed!"); 222 errorcnt++; 217 223 gettimeofday(×tamp, NULL); 218 224 return -1; 219 225 } 220 226 errorcnt = 0; 221 227 debug("[MPD] connection fixed..."); 222 228 } … … 568 574 { 569 575 int check; 570 debug("[MPD] v0.8 1, check lcd4linux configuration file...");576 debug("[MPD] v0.82, check lcd4linux configuration file..."); 571 577 572 578 check = configure_mpd();
