[SCM] morituri/master: * morituri/common/common.py: Add an EmptyError. * morituri/common/checksum.py: Set it when we don't get any frames. * morituri/rip/main.py: Catch it and stop ripping if this happens.
js at users.alioth.debian.org
js at users.alioth.debian.org
Sun Oct 19 20:09:27 UTC 2014
The following commit has been merged in the master branch:
commit 234ac4c644e6da8c0fd6f3da7cead134822bf534
Author: Thomas Vander Stichele <thomas (at) apestaart (dot) org>
Date: Tue May 24 15:15:44 2011 +0000
* morituri/common/common.py:
Add an EmptyError.
* morituri/common/checksum.py:
Set it when we don't get any frames.
* morituri/rip/main.py:
Catch it and stop ripping if this happens.
diff --git a/ChangeLog b/ChangeLog
index b9fb218..7e02960 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,14 @@
2011-05-24 Thomas Vander Stichele <thomas at apestaart dot org>
+ * morituri/common/common.py:
+ Add an EmptyError.
+ * morituri/common/checksum.py:
+ Set it when we don't get any frames.
+ * morituri/rip/main.py:
+ Catch it and stop ripping if this happens.
+
+2011-05-24 Thomas Vander Stichele <thomas at apestaart dot org>
+
* morituri/common/task.py:
More exception handling and debug.
diff --git a/morituri/common/checksum.py b/morituri/common/checksum.py
index 5e6e4b1..ac34030 100644
--- a/morituri/common/checksum.py
+++ b/morituri/common/checksum.py
@@ -30,7 +30,6 @@ from morituri.common import common, task, gstreamer
# checksums are not CRC's. a CRC is a specific type of checksum.
-
class ChecksumTask(gstreamer.GstPipelineTask):
"""
I am a task that calculates a checksum of the decoded audio data.
@@ -91,7 +90,6 @@ class ChecksumTask(gstreamer.GstPipelineTask):
length, qformat = sink.query_duration(gst.FORMAT_DEFAULT)
except gst.QueryError, e:
self.setException(e)
- self.stop()
return
# wavparse 0.10.14 returns in bytes
@@ -141,8 +139,7 @@ class ChecksumTask(gstreamer.GstPipelineTask):
def stopped(self):
if not self._last:
# see http://bugzilla.gnome.org/show_bug.cgi?id=578612
- print 'ERROR: checksum: not a single buffer gotten'
- # FIXME: instead of print, do something useful
+ self.setException(common.EmptyError('not a single buffer gotten'))
else:
self._checksum = self._checksum % 2 ** 32
self.debug("last offset %r", self._last.offset)
diff --git a/morituri/common/common.py b/morituri/common/common.py
index 4f221d6..7833bf0 100644
--- a/morituri/common/common.py
+++ b/morituri/common/common.py
@@ -212,9 +212,14 @@ def tagListEquals(tl1, tl2):
return d1 == d2
+
class MissingDependencyException(Exception):
dependency = None
def __init__(self, *args):
self.args = args
self.dependency = args[0]
+
+
+class EmptyError(Exception):
+ pass
diff --git a/morituri/rip/main.py b/morituri/rip/main.py
index 69bae1e..0754821 100644
--- a/morituri/rip/main.py
+++ b/morituri/rip/main.py
@@ -31,6 +31,12 @@ cdrdao says:
%s
""" % e.exception.msg)
return 255
+
+ if isinstance(e.exception, common.EmptyError):
+ sys.stderr.write(
+ 'rip: error: Could not create encoded file.\n')
+ return 255
+
raise
if ret is None:
--
morituri packaging
More information about the pkg-multimedia-commits
mailing list