emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/emms d32a9bbc8f 3/3: * emms-player-mpv.el: do not use -


From: ELPA Syncer
Subject: [elpa] externals/emms d32a9bbc8f 3/3: * emms-player-mpv.el: do not use --playlist/loadlist by default
Date: Mon, 31 Jan 2022 00:57:32 -0500 (EST)

branch: externals/emms
commit d32a9bbc8ffcd736c4aa33a6dcea819a01b8e808
Author: Mike Kazantsev <mk.fraggod@gmail.com>
Commit: fraggod@malediction <mk.fraggod@gmail.com>

    * emms-player-mpv.el: do not use --playlist/loadlist by default
    
    Upstream mpv documentation explicitly discourages use of this option,
    and it should not be necessary for common playlist formats with modern mpv.
    emms-player-mpv-use-playlist-option can be enabled to use it anyway for
    compatibility with e.g. plaintext filename lists.
---
 emms-player-mpv.el | 22 +++++++++++++++++-----
 1 file changed, 17 insertions(+), 5 deletions(-)

diff --git a/emms-player-mpv.el b/emms-player-mpv.el
index ebae0a95ad..348dbf9d65 100644
--- a/emms-player-mpv.el
+++ b/emms-player-mpv.el
@@ -178,6 +178,14 @@ example.  Uses `emms-player-mpv-event-connect-hook' and
                              #'emms-player-mpv-info-meta-event-func))))
                       value)))
 
+(defcustom emms-player-mpv-use-playlist-option nil
+       "Use --playlist option and loadlist mpv command for playlist files and 
URLs.
+
+Use of this option is explicitly discouraged by mpv documentation for security
+reasons, and should be unnecessary in most common cases with modern mpv.
+Make sure to check mpv manpage for --playlist option before enabling this."
+       :type 'boolean)
+
 
 (defvar emms-player-mpv-proc nil
   "Running mpv process, controlled over --input-ipc-server/--input-file 
sockets.")
@@ -847,19 +855,23 @@ version."
   (emms-player-mpv-proc-playing nil)
   (let
       ((track-name (emms-track-get track 'name))
-       (track-is-playlist (memq (emms-track-get track 'type)
-                                '(streamlist playlist))))
+       (track-playlist-option
+        (and emms-player-mpv-use-playlist-option
+             (memq (emms-track-get track 'type)
+                   '(streamlist playlist)))))
     (if (emms-player-mpv-ipc-fifo-p)
         (progn
           ;; ipc-stop is to clear any buffered commands
           (emms-player-mpv-ipc-stop)
-          (emms-player-mpv-proc-init (if track-is-playlist "--playlist" "--")
-                                     track-name)
+          (apply 'emms-player-mpv-proc-init
+                 (if track-playlist-option
+                     (list (concat "--playlist=" track-name))
+                   (list "--" track-name)))
           (emms-player-started emms-player-mpv))
       (let*
           ((play-cmd
             `(batch
-              ((,(if track-is-playlist 'loadlist 'loadfile)
+              ((,(if track-playlist-option 'loadlist 'loadfile)
                 ,track-name replace))
               ((set pause no))))
            (start-func



reply via email to

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