>From 99cf5b4b9ca76f31e523c942b63b0db6bc5e5e74 Mon Sep 17 00:00:00 2001 From: Morgan Veyret Date: Wed, 15 Oct 2008 22:11:11 +0200 Subject: [PATCH] Moved mpd ping timer initialization to init-mpd-connection. This should fix the annoying error messages when loading mpd.lisp without calling mpd-connect or without mpd running. --- contrib/mpd.lisp | 7 ++++--- 1 files changed, 4 insertions(+), 3 deletions(-) diff --git a/contrib/mpd.lisp b/contrib/mpd.lisp index 1d2572f..7be1f68 100644 --- a/contrib/mpd.lisp +++ b/contrib/mpd.lisp @@ -49,9 +49,7 @@ (defvar *mpd-timeout* 50) -(defparameter *mpd-timer* - (when *mpd-timeout* - (run-with-timer *mpd-timeout* *mpd-timeout* 'mpd-ping))) +(defparameter *mpd-timer* nil) (defvar *mpd-collapse-album-length* nil) (defvar *mpd-collapse-all-length* nil) @@ -133,6 +131,9 @@ (err) (format t "Error connecting to mpd: ~a~%" err)))) (when *mpd-socket* + (when *mpd-timeout* + (setf *mpd-timer* + (run-with-timer *mpd-timeout* *mpd-timeout* 'mpd-ping))) (read-line *mpd-socket*))) (defun close-mpd-connection () -- 1.5.5.1