emms-help
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

MPD player status change bug


From: Ryan Van Wagoner
Subject: MPD player status change bug
Date: Sun, 23 Jan 2022 20:08:50 -0700

Hello:

I believe I have detected a bug in the emms-player-mpd backend that
prevents the playlist from updating as MPD plays songs. This results
in the playlist not updating until the mpd playlist is complete and
causes an inverted pyramid playback style (e.g. a five track playlist
will play songs 1-5, then 2-5, then 3-5, etc).

The cause of the problem appears to be a swapping of argument order
for the function run-at-time in two places in the source code. The
calls in question have the first argument t (for continuous
rescheduling) and the second argument being the update interval. The
function should instead be called with the update interval first and
the bool argument second.

The following patch should fix the problem:

diff --git a/emms-player-mpd.el b/emms-player-mpd.el
index 5ac48fa..3267988 100644
--- a/emms-player-mpd.el
+++ b/emms-player-mpd.el
@@ -873,7 +873,7 @@ playlist."
           (setq emms-player-mpd-current-song nil)
           (if emms-player-mpd-check-interval
               (setq emms-player-mpd-status-timer
-                    (run-at-time t emms-player-mpd-check-interval
+                    (run-at-time emms-player-mpd-check-interval t
                                  #'emms-player-mpd-detect-song-change))
             (emms-player-mpd-detect-song-change)))))
     ;; we only want to play one track, so don't start the timer
@@ -944,7 +944,7 @@ This is called if `emms-player-mpd-sync-playlist' is 
non-nil."
       (emms-player-mpd-detect-song-change info)
       (when emms-player-mpd-check-interval
        (setq emms-player-mpd-status-timer
-             (run-at-time t emms-player-mpd-check-interval
+             (run-at-time emms-player-mpd-check-interval t
                           #'emms-player-mpd-detect-song-change))))))
 
 ;;;###autoload

Thanks for the work on providing and maintaining this useful program.

Best regards,

Ryan Van Wagoner



reply via email to

[Prev in Thread] Current Thread [Next in Thread]