From 4150a25e6930608c8a6f04bc948f7c376b39dddf Mon Sep 17 00:00:00 2001 From: Michael Olson Date: Thu, 3 Aug 2006 03:00:00 +0000 Subject: emms-player-mpd: Use better algorithm to detect whether the user has requested a stop or whether we have run out of tracks. Thanks to dds for the report. darcs-hash:20060803030044-1bfb2-8ae4e59fcafcbfff9b8b2e764aceb82d80c16faf.gz --- emms-player-mpd.el | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/emms-player-mpd.el b/emms-player-mpd.el index bf36757..f064ec2 100644 --- a/emms-player-mpd.el +++ b/emms-player-mpd.el @@ -667,15 +667,13 @@ MusicPD playlist." (time (emms-player-mpd-get-playing-time nil #'ignore info))) (cond ((string= status "stop") (emms-player-mpd-disconnect t) - (if (with-current-emms-playlist - (save-excursion - (forward-line 1) - (emms-playlist-track-at (point)))) - ;; a track remains, so use the conservative stop method + (if song + ;; a track remains: the user probably stopped MusicPD + ;; manually, so we'll stop EMMS completely (let ((emms-player-stopped-p t)) (emms-player-stopped)) - ;; at the last track: we probably ran out of stuff to - ;; play, so let EMMS do something further if it wants to + ;; 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))) ((string= status "pause") nil) -- cgit v1.2.3