* morituri/program/cdparanoia.py:
Add some debug. * morituri/common/encode.py: Add more debug. Handle the case where peak is full scale, and peakdB thus 0, which triggered not setting self.peak.
This commit is contained in:
@@ -1,3 +1,12 @@
|
||||
2010-04-08 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
* morituri/program/cdparanoia.py:
|
||||
Add some debug.
|
||||
* morituri/common/encode.py:
|
||||
Add more debug.
|
||||
Handle the case where peak is full scale, and peakdB thus 0,
|
||||
which triggered not setting self.peak.
|
||||
|
||||
2010-04-06 Thomas Vander Stichele <thomas at apestaart dot org>
|
||||
|
||||
patch by: Peter Oliver.
|
||||
|
||||
@@ -123,6 +123,8 @@ class EncodeTask(task.Task):
|
||||
@type peak: float
|
||||
"""
|
||||
|
||||
logCategory = 'EncodeTask'
|
||||
|
||||
description = 'Encoding'
|
||||
peak = None
|
||||
|
||||
@@ -244,6 +246,7 @@ class EncodeTask(task.Task):
|
||||
|
||||
for p in s['peak']:
|
||||
if self._peakdB < p:
|
||||
self.log('higher peakdB found, now %r', self._peakdB)
|
||||
self._peakdB = p
|
||||
|
||||
def stop(self):
|
||||
@@ -256,5 +259,8 @@ class EncodeTask(task.Task):
|
||||
self.debug('set state to NULL')
|
||||
task.Task.stop(self)
|
||||
|
||||
if self._peakdB:
|
||||
if self._peakdB is not None:
|
||||
self.debug('peakdB %r', self._peakdB)
|
||||
self.peak = math.sqrt(math.pow(10, self._peakdB / 10.0))
|
||||
else:
|
||||
self.warning('No peak found, something went wrong!')
|
||||
|
||||
@@ -405,6 +405,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
||||
if not self.exception:
|
||||
self.quality = max(self.tasks[0].quality, self.tasks[2].quality)
|
||||
self.peak = self.tasks[4].peak
|
||||
self.debug('peak: %r', self.peak)
|
||||
|
||||
self.testchecksum = c1 = self.tasks[1].checksum
|
||||
self.copychecksum = c2 = self.tasks[3].checksum
|
||||
@@ -424,5 +425,7 @@ class ReadVerifyTrackTask(task.MultiSeparateTask):
|
||||
shutil.move(self._tmppath, self.path)
|
||||
except Exception, e:
|
||||
self._exception = e
|
||||
else:
|
||||
self.debug('stop: exception %r', self.exception)
|
||||
|
||||
task.MultiSeparateTask.stop(self)
|
||||
|
||||
Reference in New Issue
Block a user