* 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:
Thomas Vander Stichele
2010-04-08 21:06:52 +00:00
parent 1a5a32f7d1
commit e124c79c64
3 changed files with 19 additions and 1 deletions

View File

@@ -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.

View File

@@ -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!')

View File

@@ -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)