Update.
[elisp.git] / media-mplayer.el
index ff1747e..89b76e9 100644 (file)
 ;; Is it me, or the slave mode of mplayer is ugly to parse? Did I miss
 ;; something?
 
+(defcustom media/mplayer/executable "mplayer"
+  "The name of the executable."
+  :type 'string
+  :group 'media)
+
 (defcustom media/mplayer/args nil
   "List of arguments for mplayer."
   :type 'list
@@ -94,8 +99,8 @@ load Emacs less. Nil means no timing."
                               (let ((s (match-string 1 param)))
                                 (concat (if (string= s "")
                                             "<no title>"
-                                          ;; (encode-coding-string s 'latin-1)
-                                          s
+                                          (encode-coding-string s 'latin-1)
+                                          ;; s
                                           )
                                         " | "
                                         (format-time-string "%a %b %d %H:%M:%S")
@@ -110,10 +115,11 @@ load Emacs less. Nil means no timing."
                       )
 
                     (when media/mplayer/capture-dir
-                      (with-temp-buffer
-                        (insert
-                         (concat media/current-song-in-stream "\n"))
-                        (write-region nil nil (concat media/mplayer/capture-dir "/log") t)))
+                      (let ((coding-system-for-write 'raw-text-unix))
+                        (with-temp-buffer
+                          (insert
+                           (concat media/current-song-in-stream "\n"))
+                          (write-region nil nil (concat media/mplayer/capture-dir "/log") t))))
 
                     (if (and media/current-song-in-stream media/current-information)
                         (media/show-current-information))
@@ -282,7 +288,7 @@ load Emacs less. Nil means no timing."
         (apply
          'start-process
          (append
-          '("mplayer" nil "mplayer" "-slave" "-quiet")
+          `("mplayer" nil ,media/mplayer/executable "-slave" "-quiet")
           media/mplayer/args
           (when (string-match  "\\(asx\\|m3u\\|pls\\|ram\\)$" media/mplayer/url)
             (if media/mplayer/capture-dir