[SCM] morituri/master: * morituri/common/program.py: * morituri/program/cdparanoia.py: * morituri/result/result.py: Track ripping speed for test and encode per-track.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:46 UTC 2014
The following commit has been merged in the master branch:
commit e67ad238948cfa5ae371b9cc5d781e8dbafe108d
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Tue Nov 27 08:09:51 2012 +0000
* morituri/common/program.py:
* morituri/program/cdparanoia.py:
* morituri/result/result.py:
Track ripping speed for test and encode per-track.
diff --git a/ChangeLog b/ChangeLog
index ee1c259..41fba5f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2012-11-27 Thomas Vander Stichele <thomas at apestaart dot org>
+
+ * morituri/common/program.py:
+ * morituri/program/cdparanoia.py:
+ * morituri/result/result.py:
+ Track ripping speed for test and encode per-track.
+
2012-11-25 Thomas Vander Stichele <thomas at apestaart dot org>
patch by: mustbenice
diff --git a/morituri/common/program.py b/morituri/common/program.py
index 049884d..76d9c1d 100644
--- a/morituri/common/program.py
+++ b/morituri/common/program.py
@@ -476,6 +476,9 @@ class Program(log.Loggable):
trackResult.quality = t.quality
trackResult.testspeed = t.testspeed
trackResult.copyspeed = t.copyspeed
+ # we want rerips to add cumulatively to the time
+ trackResult.testduration += t.testduration
+ trackResult.copyduration += t.copyduration
if trackResult.filename != t.path:
trackResult.filename = t.path
diff --git a/morituri/program/cdparanoia.py b/morituri/program/cdparanoia.py
index c7d8462..31ba244 100644
--- a/morituri/program/cdparanoia.py
+++ b/morituri/program/cdparanoia.py
@@ -205,6 +205,7 @@ class ReadTrackTask(log.Loggable, task.Task):
description = "Reading track"
quality = None # set at end of reading
speed = None
+ duration = None # in seconds
_MAXERROR = 100 # number of errors detected by parser
@@ -373,7 +374,8 @@ class ReadTrackTask(log.Loggable, task.Task):
self.exception = ReturnCodeError(self._popen.returncode)
self.quality = self._parser.getTrackQuality()
- self.speed = (offsetLength / 75.0) / (end_time - self._start_time)
+ self.duration = end_time - self._start_time
+ self.speed = (offsetLength / 75.0) / self.duration
self.stop()
return
@@ -382,6 +384,7 @@ class ReadTrackTask(log.Loggable, task.Task):
class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
"""
I am a task that reads and verifies a track using cdparanoia.
+ I also encode the track.
The path where the file is stored can be changed if necessary, for
example if the file name is too long.
@@ -390,6 +393,12 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
@ivar checksum: the checksum of the track; set if they match.
@ivar testchecksum: the test checksum of the track.
@ivar copychecksum: the copy checksum of the track.
+ @ivar testspeed: the test speed of the track, as a multiple of
+ track duration.
+ @ivar copyspeed: the copy speed of the track, as a multiple of
+ track duration.
+ @ivar testduration: the test duration of the track, in seconds.
+ @ivar copyduration: the copy duration of the track, in seconds.
@ivar peak: the peak level of the track
"""
@@ -400,6 +409,8 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
quality = None
testspeed = None
copyspeed = None
+ testduration = None
+ copyduration = None
_tmpwavpath = None
_tmppath = None
@@ -481,6 +492,8 @@ class ReadVerifyTrackTask(log.Loggable, task.MultiSeparateTask):
self.debug('peak: %r', self.peak)
self.testspeed = self.tasks[0].speed
self.copyspeed = self.tasks[2].speed
+ self.testduration = self.tasks[0].duration
+ self.copyduration = self.tasks[2].duration
self.testchecksum = c1 = self.tasks[1].checksum
self.copychecksum = c2 = self.tasks[3].checksum
diff --git a/morituri/result/result.py b/morituri/result/result.py
index 73f1809..58bb7e2 100644
--- a/morituri/result/result.py
+++ b/morituri/result/result.py
@@ -62,6 +62,8 @@ class TrackResult:
quality = 0.0
testspeed = 0.0
copyspeed = 0.0
+ testduration = 0.0
+ copyduration = 0.0
testcrc = None
copycrc = None
accurip = False # whether it's in the database
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list