aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-info-ogginfo.el57
1 files changed, 28 insertions, 29 deletions
diff --git a/emms-info-ogginfo.el b/emms-info-ogginfo.el
index b6f4a0e..e05db82 100644
--- a/emms-info-ogginfo.el
+++ b/emms-info-ogginfo.el
@@ -49,35 +49,34 @@ This is a useful element for `emms-info-functions'."
(string-match "\\.[Oo][Gg][Gg]\\'" (emms-track-name track)))
(with-temp-buffer
- (when (zerop
- (call-process emms-info-ogginfo-program-name
- nil t nil (emms-track-name track)))
-
- ;; play time, emms-info-ogg.el [U. Jensen]
- (goto-char (point-min))
- (re-search-forward "Playback length: \\([0-9]*\\)m:\\([0-9]*\\)")
- (let* ((minutes (string-to-number (match-string 1)))
- (seconds (string-to-number (match-string 2)))
- (ptime-total (+ (* minutes 60) seconds))
- (ptime-min minutes)
- (ptime-sec seconds))
- (emms-track-set track 'info-playing-time ptime-total)
- (emms-track-set track 'info-playing-time-min ptime-min)
- (emms-track-set track 'info-playing-time-sec ptime-sec)
- (emms-track-set track 'info-file (emms-track-name track)))
-
- ;; all the rest of the info available
- (goto-char (point-min))
- (when (re-search-forward "^.*\\.\\.\\.$" (point-max) t)
- (while (zerop (forward-line 1))
- (when (looking-at "^\t\\(.*\\)=\\(.*\\)$")
- (let ((a (match-string 1))
- (b (match-string 2)))
- (when (and (< 0 (length a))
- (< 0 (length b)))
- (emms-track-set track
- (intern (downcase (concat "info-" (match-string 1))))
- (match-string 2)))))))))))
+ (call-process emms-info-ogginfo-program-name
+ nil t nil (emms-track-name track))
+
+ ;; play time, emms-info-ogg.el [U. Jensen]
+ (goto-char (point-min))
+ (re-search-forward "Playback length: \\([0-9]*\\)m:\\([0-9]*\\)")
+ (let* ((minutes (string-to-number (match-string 1)))
+ (seconds (string-to-number (match-string 2)))
+ (ptime-total (+ (* minutes 60) seconds))
+ (ptime-min minutes)
+ (ptime-sec seconds))
+ (emms-track-set track 'info-playing-time ptime-total)
+ (emms-track-set track 'info-playing-time-min ptime-min)
+ (emms-track-set track 'info-playing-time-sec ptime-sec)
+ (emms-track-set track 'info-file (emms-track-name track)))
+
+ ;; all the rest of the info available
+ (goto-char (point-min))
+ (when (re-search-forward "^.*\\.\\.\\.$" (point-max) t)
+ (while (zerop (forward-line 1))
+ (when (looking-at "^\t\\(.*\\)=\\(.*\\)$")
+ (let ((a (match-string 1))
+ (b (match-string 2)))
+ (when (and (< 0 (length a))
+ (< 0 (length b)))
+ (emms-track-set track
+ (intern (downcase (concat "info-" (match-string 1))))
+ (match-string 2))))))))))
(provide 'emms-info-ogginfo)