[SCM] morituri/master: better debugging when sampleLength is claimed unknown
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:54 UTC 2014
The following commit has been merged in the master branch:
commit 4a24671bcee67ad441244eaf0db55fdfc2547880
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Fri Jan 18 19:36:38 2013 +0100
better debugging when sampleLength is claimed unknown
diff --git a/morituri/common/checksum.py b/morituri/common/checksum.py
index 52debea..96d0260 100644
--- a/morituri/common/checksum.py
+++ b/morituri/common/checksum.py
@@ -58,13 +58,23 @@ class ChecksumTask(log.Loggable, gstreamer.GstPipelineTask):
@type sampleStart: int
@param sampleStart: the sample to start at
"""
+
+ # sampleLength can be e.g. -588 when it is -1 * SAMPLES_PER_FRAME
+
assert type(path) is unicode, "%r is not unicode" % path
self.logName = "ChecksumTask 0x%x" % id(self)
# use repr/%r because path can be unicode
- self.debug('Creating checksum task on %r from sample %d to sample %d',
- path, sampleStart, sampleLength)
+ if sampleLength < 0:
+ self.debug(
+ 'Creating checksum task on %r from sample %d until the end',
+ path, sampleStart)
+ else:
+ self.debug(
+ 'Creating checksum task on %r from sample %d for %d samples',
+ path, sampleStart, sampleLength)
+
if not os.path.exists(path):
raise IndexError('%r does not exist' % path)
@@ -106,7 +116,7 @@ class ChecksumTask(log.Loggable, gstreamer.GstPipelineTask):
if qformat == gst.FORMAT_BYTES:
self.debug('query returned in BYTES format')
length /= 4
- self.debug('total length: %r', length)
+ self.debug('total sample length of file: %r', length)
self._sampleLength = length - self._sampleStart
self.debug('audio sample length is %r', self._sampleLength)
else:
diff --git a/morituri/image/image.py b/morituri/image/image.py
index 95c6ea0..5d16f3a 100644
--- a/morituri/image/image.py
+++ b/morituri/image/image.py
@@ -120,8 +120,11 @@ class AccurateRipChecksumTask(log.Loggable, task.MultiSeparateTask):
for trackIndex, track in enumerate(cue.table.tracks):
index = track.indexes[1]
length = cue.getTrackLength(track)
- self.debug('track %d is %d samples long' % (
- trackIndex + 1, length))
+ if length < 0:
+ self.debug('track %d has unknown length' % (trackIndex + 1, ))
+ else:
+ self.debug('track %d is %d samples long' % (
+ trackIndex + 1, length))
path = image.getRealPath(index.path)
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list