aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Olson <mwolson@gnu.org>2006-08-03 03:00:00 +0000
committerMichael Olson <mwolson@gnu.org>2006-08-03 03:00:00 +0000
commit4150a25e6930608c8a6f04bc948f7c376b39dddf (patch)
tree0e0e47b16f7611f1dcdb27882864c47b561ac988
parent88658d69d9b9ad2c9b4ad00b199bd80d93b4d534 (diff)
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
-rw-r--r--emms-player-mpd.el12
1 files 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)