diff options
author | william.xwl <william.xwl> | 2006-08-13 17:15:00 +0000 |
---|---|---|
committer | william.xwl <mwolson@gnu.org> | 2006-08-13 17:15:00 +0000 |
commit | 8bc775c9d178e5c64fc7b377e668b39414b127ba (patch) | |
tree | cce7ad455a23de84e8a8560178a5127fb5b5b19a | |
parent | 043320f4cb7dd763ffe6df95b0f1c68ecf7f82f2 (diff) |
emms-info-ogginfo.el: Add check for retrieving ogginfo.
darcs-hash:20060813171527-e8fe6-7d86d1ced2affec422819799253f818c5c5e717e.gz
-rw-r--r-- | emms-info-ogginfo.el | 21 |
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)) |