From a31cdb0104a6ee08761cdca69c31f3671205ac30 Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Wed, 16 Jul 2008 23:30:59 -0700 Subject: emms-player-mpd: Only try once to read tracks after running out of them. This fixes a bug introduced in the last commit. --- lisp/emms-player-mpd.el | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/lisp/emms-player-mpd.el b/lisp/emms-player-mpd.el index c1ad17b..692bd83 100644 --- a/lisp/emms-player-mpd.el +++ b/lisp/emms-player-mpd.el @@ -664,15 +664,17 @@ main EMMS playlist buffer." "clearerror" nil #'ignore)) (cond ((string= state "stop") - (setq emms-player-mpd-last-state "stop") (if song ;; a track remains: the user probably stopped MusicPD ;; manually, so we'll stop EMMS completely (let ((emms-player-stopped-p t)) + (setq emms-player-mpd-last-state "stop") (emms-player-stopped)) ;; no more tracks are left: we probably ran out of things ;; to play, so let EMMS do something further if it wants - (emms-player-stopped))) + (unless (string= emms-player-mpd-last-state "stop") + (setq emms-player-mpd-last-state "stop") + (emms-player-stopped)))) ((and emms-player-mpd-last-state (string= emms-player-mpd-last-state "stop")) ;; resume from a stop that occurred outside of EMMS -- cgit v1.2.3