Hi Arne,

While testing the previous patch I noticed that jack doesn't handle
the situation when cdda2wav prints a warning, for example because you
don't have permission to read from the device.

Patch:
Make cdda2wav parsing more robust, in particular when errors occur.

diff -urN jack-3.1.1~/jack_helpers.py jack-3.1.1/jack_helpers.py
--- jack-3.1.1~/jack_helpers.py 2006-01-23 23:40:49.000000000 +0000
+++ jack-3.1.1/jack_helpers.py  2006-01-24 00:44:57.000000000 +0000
@@ -321,10 +321,23 @@
         'status_fkt': r"""
 tmp = string.split(i['buf'], "\r")
 if len(tmp) >= 2:
-    if string.find(tmp[-2], '%') != -1:
-        new_status = "ripping: " + string.strip(tmp[-2])
-    else:
+    tmp = tmp[-2].lstrip()
+    pct = tmp.find("%")
+    if pct == -1:
         new_status = "waiting..."
+    else:
+        # A normal line when it's ripping looks like this:
+        #   7%
+        # However, when an error occurs, it'll look something like this:
+        #   0%cdda2wav: Operation not permitted. Cannot send SCSI cmd via ioctl
+        info = tmp[:pct+1]
+        error = info + "cdda2wav:"
+        if tmp == info:
+            new_status = "ripping: " + info
+        elif tmp.startswith(error):
+            new_status = "Error: " + tmp[len(error):].lstrip()
+        else:
+            new_status = "Cannot parse status"
 else:
     new_status = "Cannot parse status"
 """,

-- 
Martin Michlmayr
http://www.cyrius.com/


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to