aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--emms-info-ogginfo.el21
1 files changed, 11 insertions, 10 deletions
diff --git a/emms-info-ogginfo.el b/emms-info-ogginfo.el
index 4017d47..34e45ca 100644
--- a/emms-info-ogginfo.el
+++ b/emms-info-ogginfo.el
@@ -55,16 +55,17 @@ This is a useful element for `emms-info-functions'."
;; 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)))
+ (when (re-search-forward
+ "Playback length: \\([0-9]*\\)m:\\([0-9]*\\)" nil t)
+ (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))