[SCM] morituri/master: * morituri/common/common.py: * morituri/image/cue.py: Use FRAMES_PER_SECOND where appropriate.

js at users.alioth.debian.org js at users.alioth.debian.org
Sun Oct 19 20:09:00 UTC 2014


The following commit has been merged in the master branch:
commit 22ee8651d6638e5a71dc0fb5806b05b775c0d500
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date:   Sat May 16 09:24:24 2009 +0000

    	* morituri/common/common.py:
    	* morituri/image/cue.py:
    	  Use FRAMES_PER_SECOND where appropriate.

diff --git a/ChangeLog b/ChangeLog
index 08baf28..1b92c6a 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2009-05-16  Thomas Vander Stichele  <thomas at apestaart dot org>
 
+	* morituri/common/common.py:
+	* morituri/image/cue.py:
+	  Use FRAMES_PER_SECOND where appropriate.
+
+2009-05-16  Thomas Vander Stichele  <thomas at apestaart dot org>
+
 	* morituri/common/checksum.py:
 	* morituri/common/common.py:
 	* morituri/image/image.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,

-- 
morituri packaging



More information about the pkg-multimedia-commits mailing list