Alex Kost <alez...@gmail.com> writes:

>>    (condition-case excep
>>        (call-process "mplayer" nil t nil
>>                  "-cache" "256"
>>                  "-endpos" "0" "-vo" "null" "-ao" "null"
>>                  "-msglevel" "all=-1:network=4:demuxer=4"
>> +                urlcall
>                     (if (eq type 'streamlist) "-playlist" "")
>                     ^^^^^^^^^
> or even just put this line here directly instead of making 'urlcall'
> variable.

You're right it's much simpler this way. Here is the corresponding
patch.

Julien.

>From 3bdb566752c311d79aa341a6f0ce37cdbaec97fa Mon Sep 17 00:00:00 2001
From: Julien Cubizolles <j.cubizol...@free.fr>
Date: Sun, 30 Oct 2016 12:03:06 +0100
Subject: [PATCH 2/2] mplayer option to parse webradio playlists

---
 lisp/emms-stream-info.el | 11 ++++++-----
 lisp/emms-streams.el     |  5 +++--
 2 files changed, 9 insertions(+), 7 deletions(-)

diff --git a/lisp/emms-stream-info.el b/lisp/emms-stream-info.el
index 8cf8195..49b8ad4 100644
--- a/lisp/emms-stream-info.el
+++ b/lisp/emms-stream-info.el
@@ -57,13 +57,14 @@
 		(> (length (match-string-no-properties 1)) 0))
        (setq ,symname (match-string-no-properties 1)))))
 
-(defun emms-stream-info-mplayer-backend (url)
+(defun emms-stream-info-mplayer-backend (url type)
   "Backend command for running mplayer on URL."
   (condition-case excep
       (call-process "mplayer" nil t nil
 		    "-cache" "256"
 		    "-endpos" "0" "-vo" "null" "-ao" "null"
 		    "-msglevel" "all=-1:network=4:demuxer=4"
+		    (if (eq type 'streamlist) "-playlist" "")
 		    url)
     (file-error
      (error "Could not find the mplayer backend binary"))))
@@ -77,7 +78,7 @@
     (file-error
      (error "Could not find the VLC backend binary"))))
 
-(defun emms-stream-info-call-backend (url)
+(defun emms-stream-info-call-backend (url type)
   "Call backend and return a list of stream information for URL."
   (let ((name "N/A")
 	(genre "N/A")
@@ -87,7 +88,7 @@
       (message "querying stream...")
       (cond
        ((eq *emms-stream-info-backend* 'mplayer)
-	(emms-stream-info-mplayer-backend url)
+	(emms-stream-info-mplayer-backend url type)
 	(emms-stream-info-defreg name "^Name[ ]+:[ ]+\\(.*\\)$")
 	(emms-stream-info-defreg genre "^Genre[ ]+:[ ]+\\(.*\\)$")
 	(emms-stream-info-defreg bitrate "^Bitrate[ ]+:[ ]+\\(.*\\)$")
@@ -103,10 +104,10 @@
     (list name genre bitrate nowplaying)))
 
 ;; point of entry
-(defun emms-stream-info-message (url)
+(defun emms-stream-info-message (url type)
   "Display a message with information about the stream at URL."
   (interactive "Murl: ")
-  (let* ((stream-info (emms-stream-info-call-backend url))
+  (let* ((stream-info (emms-stream-info-call-backend url type))
 	 (name (nth 0 stream-info))
 	 (genre (nth 1 stream-info))
 	 (bitrate (nth 2 stream-info))
diff --git a/lisp/emms-streams.el b/lisp/emms-streams.el
index 41de8d2..3b19224 100644
--- a/lisp/emms-streams.el
+++ b/lisp/emms-streams.el
@@ -478,8 +478,9 @@ Don't forget to save your modifications !"
   (interactive)
   (if (fboundp 'emms-stream-info-message)
       (let* ((line (get-text-property (point) 'emms-stream))
-	     (url (emms-stream-url line)))
-	(emms-stream-info-message url))
+	     (url (emms-stream-url line))
+	     (type (emms-stream-type line)))
+	(emms-stream-info-message url type))
     (message "Streaming media info not available.")))
 
 ;; Killing and yanking
-- 
2.9.3

_______________________________________________
Emms-help mailing list
Emms-help@gnu.org
https://lists.gnu.org/mailman/listinfo/emms-help

Reply via email to