[SCM] morituri/master: * morituri/program/cdparanoia.py: Since stop can be same as start, add + 1 to progress calculation. Fiexes #37.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:24 UTC 2014
The following commit has been merged in the master branch:
commit b32a534a82dcbff7d5d600599c1d99b31ff85802
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Sun May 22 15:16:00 2011 +0000
* morituri/program/cdparanoia.py:
Since stop can be same as start, add + 1 to progress calculation.
Fiexes #37.
diff --git a/ChangeLog b/ChangeLog
index 782ab44..ddf8a40 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
2011-05-22 Thomas Vander Stichele <thomas at apestaart dot org>
+ * morituri/program/cdparanoia.py:
+ Since stop can be same as start, add + 1 to progress calculation.
+ Fiexes #37.
+
+2011-05-22 Thomas Vander Stichele <thomas at apestaart dot org>
+
* morituri/common/gstreamer.py:
Remove unused imports.
* morituri/image/image.py:
diff --git a/morituri/program/cdparanoia.py b/morituri/program/cdparanoia.py
index dc23a5b..4c3bd1f 100644
--- a/morituri/program/cdparanoia.py
+++ b/morituri/program/cdparanoia.py
@@ -203,7 +203,7 @@ class ReadTrackTask(task.Task):
@type table: L{table.Table}
@param start: first frame to rip
@type start: int
- @param stop: last frame to rip (inclusive)
+ @param stop: last frame to rip (inclusive); >= start
@type stop: int
@param offset: read offset, in samples
@type offset: int
@@ -305,9 +305,11 @@ class ReadTrackTask(task.Task):
self.debug('%d errors, terminating', self._parser.errors)
self._popen.terminate()
- num = float(self._parser.wrote) - self._start
- den = float(self._stop) - self._start
- progress = num / den
+ num = self._parser.wrote - self._start + 1
+ den = self._stop - self._start + 1
+ assert den != 0, "stop %d should be >= start %d" % (
+ self._stop, self._start)
+ progress = float(num) / float(den)
if progress < 1.0:
self.setProgress(progress)
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list