Fixes bug where ogg files fail on Debian Stable (Sarge)
--- a/debian/changelog
+++ b/debian/changelog
@@ -1,3 +1,9 @@
+mp3togo (0.5.4) unstable; urgency=low
+
+ * Changed the ogg decoder to oggdec from ogg123 to fix bug on Debian Stable (Sarge).
+
+ -- Simeon Veldstra <reallifesim@gmail.com> Mon, 12 Jun 2006 19:46:05 -0700
+
mp3togo (0.5.3) unstable; urgency=low
* Added Justus Pendleton's patch to fix config file bug.
--- a/debian/mp3togo.1
+++ b/debian/mp3togo.1
@@ -134,4 +134,4 @@ License can be found in /usr/share/commo
.PP
mp3togo can be found online at http://puddle.ca/mp3togo
-.\" created by instant / docbook-to-man, Tue 06 Jun 2006, 19:24
+.\" created by instant / docbook-to-man, Mon 12 Jun 2006, 19:49
--- a/mp3togo/helpers.py
+++ b/mp3togo/helpers.py
@@ -76,6 +76,13 @@ def parse_mpg321(buf, f=frames()):
return f.frames/f.tframes * 100.0
return 0
+def parse_oggdec(buf):
+ s = buf.split('\r')
+ if len(s) == 2 and len(s[1]) == 9:
+ return float(s[1][2:7])
+ else:
+ return 0.0
+
def parse_oggenc(buf):
# From "jack"
s = buf.split('\r')
@@ -185,8 +192,13 @@ helpers = {
'type': 'wav',
'factor': 1,
'action': 'encode'},
- 'ogg123' : {'parser': parse_ogg123,
- 'cmd': 'ogg123 -d wav -f %o %i',
+# 'ogg123' : {'parser': parse_ogg123,
+# 'cmd': 'ogg123 -d wav -f %o %i',
+# 'type': 'ogg',
+# 'factor': 16.5,
+# 'action': 'decode'},
+ 'ogg123' : {'parser': parse_oggdec,
+ 'cmd': 'oggdec -o %o %i',
'type': 'ogg',
'factor': 16.5,
'action': 'decode'},
--- a/mp3togo/task.py
+++ b/mp3togo/task.py
@@ -42,13 +42,13 @@ DONE = 'done'
class SimpleTask:
"""Run a callable and save its output"""
- def __init__(self, parent, action, filter=None, reverse=None, tmpsize=0, outsize=0, name=''):
+ def __init__(self, parent, action, fltr=None, reverse=None, tmpsize=0, outsize=0, name=''):
if not action:
raise TypeError
if str(self.__class__).endswith('SimpleTask'):
if not callable(action):
raise TypeError
- for func in (filter, reverse):
+ for func in (fltr, reverse):
if func:
if not callable(func):
raise TypeError
@@ -58,7 +58,7 @@ class SimpleTask:
self.outsize = outsize
self._parent = parent
self._action = action
- self._filter = filter
+ self._filter = fltr
self._reverse = reverse
# Hold runlock while accessing self._status
self._runlock = threading.Lock()
@@ -266,7 +266,10 @@ class Task(SimpleTask):
try:
wpid, status = os.waitpid(pid, 0)
if os.WIFSIGNALED(status):
- self._status = FAILED
+ if os.WTERMSIG(status) == signal.SIGHUP:
+ self._status = FAILED
+ else:
+ self._status = FAILED
elif os.WEXITSTATUS(status) == 0:
self._status = DONE
else: