From 22ee8651d6638e5a71dc0fb5806b05b775c0d500 Mon Sep 17 00:00:00 2001 From: Thomas Vander Stichele Date: Sat, 16 May 2009 09:24:24 +0000 Subject: [PATCH] * morituri/common/common.py: * morituri/image/cue.py: Use FRAMES_PER_SECOND where appropriate. --- ChangeLog | 6 ++++++ morituri/common/common.py | 20 ++++++++++---------- morituri/image/cue.py | 4 +++- 3 files changed, 19 insertions(+), 11 deletions(-) diff --git a/ChangeLog b/ChangeLog index 08baf28..1b92c6a 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2009-05-16 Thomas Vander Stichele + + * morituri/common/common.py: + * morituri/image/cue.py: + Use FRAMES_PER_SECOND where appropriate. + 2009-05-16 Thomas Vander Stichele * morituri/common/checksum.py: diff --git a/morituri/common/common.py b/morituri/common/common.py index 298628e..c922fb7 100644 --- a/morituri/common/common.py +++ b/morituri/common/common.py @@ -44,26 +44,26 @@ def msfToFrames(msf): m, s, f = msf.split(':') - return 60 * 75 * int(m) + 75 * int(s) + int(f) + return 60 * FRAMES_PER_SECOND * int(m) + FRAMES_PER_SECOND * int(s) + int(f) def framesToMSF(frames): - f = frames % 75 + f = frames % FRAMES_PER_SECOND frames -= f - s = (frames / 75) % 60 + s = (frames / FRAMES_PER_SECOND) % 60 frames -= s * 60 - m = frames / 75 / 60 + m = frames / FRAMES_PER_SECOND / 60 return "%02d:%02d:%02d" % (m, s, f) def framesToHMSF(frames): # cdparanoia style - f = frames % 75 + f = frames % FRAMES_PER_SECOND frames -= f - s = (frames / 75) % 60 - frames -= s * 75 - m = (frames / 75 / 60) % 60 - frames -= m * 75 * 60 - h = frames / 75 / 60 / 60 + s = (frames / FRAMES_PER_SECOND) % 60 + frames -= s * FRAMES_PER_SECOND + m = (frames / FRAMES_PER_SECOND / 60) % 60 + frames -= m * FRAMES_PER_SECOND * 60 + h = frames / FRAMES_PER_SECOND / 60 / 60 return "%02d:%02d:%02d.%02d" % (h, m, s, f) diff --git a/morituri/image/cue.py b/morituri/image/cue.py index 11307d3..3309e2a 100644 --- a/morituri/image/cue.py +++ b/morituri/image/cue.py @@ -132,7 +132,9 @@ class CueFile(object, log.Loggable): frames = int(m.expand('\\4')) self.debug('found index %d', indexNumber) - frameOffset = frames + seconds * 75 + minutes * 75 * 60 + frameOffset = frames \ + + seconds * common.FRAMES_PER_SECOND \ + + minutes * common.FRAMES_PER_SECOND * 60 # FIXME: what do we do about File's FORMAT ? currentTrack.index(indexNumber, path=currentFile.path, relative=frameOffset,