[SCM] morituri/master: * morituri/common/checksum.py: More pychecker fixes.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:02 UTC 2014
The following commit has been merged in the master branch:
commit fa8239d1f551e49678b659d6be2d9ae565ddd31e
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Fri May 22 20:44:51 2009 +0000
* morituri/common/checksum.py:
More pychecker fixes.
diff --git a/ChangeLog b/ChangeLog
index 516417e..68648ec 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
2009-05-22 Thomas Vander Stichele <thomas at apestaart dot org>
+ * morituri/common/checksum.py:
+ More pychecker fixes.
+
+2009-05-22 Thomas Vander Stichele <thomas at apestaart dot org>
+
* morituri/common/common.py:
* morituri/common/renamer.py:
Pychecker fixes.
diff --git a/morituri/common/checksum.py b/morituri/common/checksum.py
index 3c9c60e..5af1f4e 100644
--- a/morituri/common/checksum.py
+++ b/morituri/common/checksum.py
@@ -247,18 +247,15 @@ class AccurateRipChecksumTask(ChecksumTask):
return checksum
values = struct.unpack("<%dI" % (len(buffer) / 4), buffer)
- sum = 0
for i, value in enumerate(values):
# self._bytes is updated after do_checksum_buffer
- sum += (self._bytes / 4 + i + 1) * value
- sum &= 0xFFFFFFFF
+ checksum += (self._bytes / 4 + i + 1) * value
+ checksum &= 0xFFFFFFFF
# offset = self._bytes / 4 + i + 1
# if offset % common.SAMPLES_PER_FRAME == 0:
# print 'THOMAS: frame %d, ends before %d, last value %08x, CRC %08x' % (
# offset / common.SAMPLES_PER_FRAME, offset, value, sum)
- checksum += sum
- checksum &= 0xFFFFFFFF
return checksum
class TRMTask(task.Task):
@@ -335,10 +332,10 @@ class TRMTask(task.Task):
def _new_buffer_cb(self, sink):
# this is just for counting progress
- buffer = sink.emit('pull-buffer')
- position = buffer.timestamp
- if buffer.duration != gst.CLOCK_TIME_NONE:
- position += buffer.duration
+ buf = sink.emit('pull-buffer')
+ position = buf.timestamp
+ if buf.duration != gst.CLOCK_TIME_NONE:
+ position += buf.duration
self.setProgress(float(position) / self._length)
def stop(self):
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list