aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYoni Rabkin <yoni@rabkins.net>2019-09-05 17:11:01 -0400
committerYoni Rabkin <yoni@rabkins.net>2019-09-05 17:11:01 -0400
commit2bad5e6cf7442cff492cafe896c47719ae77b8fb (patch)
tree7fcdbab33b0cea44b50580ed019c76ac38d8db06
parent6dfc9ffbfc91d333f1e2d4ada821e243eb868726 (diff)
parentb136d63c252aa9e9a09fcee561fe86c4aab92f20 (diff)
Merge branch 'master' of git.sv.gnu.org:/srv/git/emms
Conflicts: lisp/emms-volume.el
-rw-r--r--lisp/emms-player-mpv.el19
1 files changed, 13 insertions, 6 deletions
diff --git a/lisp/emms-player-mpv.el b/lisp/emms-player-mpv.el
index 51cbb95..54a650f 100644
--- a/lisp/emms-player-mpv.el
+++ b/lisp/emms-player-mpv.el
@@ -237,9 +237,11 @@ to indicate that playback should stop instead of switching to next track.")
"Delay before issuing `emms-player-stopped' when mpv unexpectedly goes idle.")
-(defvar emms-player-mpv-ipc-conn-emacs-26-workaround (>= emacs-major-version 26)
- "Non-nil to enable workaround for issue #31901 in emacs 26.0-26.1 and possibly later versions.
-These seem to fail to call sentinel function for unix socket network processes
+(defvar emms-player-mpv-ipc-conn-emacs-26.1-workaround
+ (and (= emacs-major-version 26)
+ (= emacs-minor-version 1))
+ "Non-nil to enable workaround for issue #31901 in emacs 26.1.
+Emacs 26.1 fails to indicate missing socket file error for unix socket network processes
that were started with :nowait t, so blocking connections are used there instead.")
@@ -452,8 +454,12 @@ MEDIA-ARGS are used instead of --idle, if specified."
(cdr DELAYS) gets passed to next connection attempt,
so it can be rescheduled further until function runs out of DELAYS values.
Sets `emms-player-mpv-ipc-proc' value to resulting process on success."
+ ;; Note - emacs handles missing unix socket files in different ways between versions:
+ ;; emacs <26 returns nil, emacs 26.1 leaves process in a stuck 'open
+ ;; state (see issue #31901), emacs 26.2+ sets 'file-missing status.
+ ;; None of these cases call sentinel function, so status must also be checked here.
(emms-player-mpv-debug-msg "ipc: connect-delay %s" (car delays))
- (let ((use-nowait (not emms-player-mpv-ipc-conn-emacs-26-workaround)))
+ (let ((use-nowait (not emms-player-mpv-ipc-conn-emacs-26.1-workaround)))
(setq emms-player-mpv-ipc-proc
(condition-case nil
(make-network-process
@@ -467,6 +473,8 @@ Sets `emms-player-mpv-ipc-proc' value to resulting process on success."
:filter #'emms-player-mpv-ipc-filter
:sentinel #'emms-player-mpv-ipc-sentinel)
(file-error nil)))
+ (unless (process-live-p emms-player-mpv-ipc-proc)
+ (setq emms-player-mpv-ipc-proc nil))
(when (and emms-player-mpv-ipc-proc (not use-nowait))
(emms-player-mpv-ipc-sentinel emms-player-mpv-ipc-proc 'open)))
(when (and (not emms-player-mpv-ipc-proc)
@@ -736,8 +744,7 @@ Called before `emms-player-mpv-event-functions' and does same thing as these hoo
(defun emms-player-mpv-cmd (cmd &optional handler)
"Send mpv command to process/connection if both are running,
or otherwise schedule start/connect and set
-`emms-player-mpv-ipc-start-track' for `emms-player-mpv-ipc-sentinel'.
-PROC can be specified to avoid `emms-player-mpv-ipc' call."
+`emms-player-mpv-ipc-start-track' for `emms-player-mpv-ipc-sentinel'."
(setq emms-player-mpv-ipc-connect-command nil)
(let ((proc (emms-player-mpv-ipc)))
(if proc