summaryrefslogtreecommitdiff
path: root/debian/patches/52_cdparanoia_toc.patch
diff options
context:
space:
mode:
Diffstat (limited to 'debian/patches/52_cdparanoia_toc.patch')
-rw-r--r--debian/patches/52_cdparanoia_toc.patch69
1 files changed, 69 insertions, 0 deletions
diff --git a/debian/patches/52_cdparanoia_toc.patch b/debian/patches/52_cdparanoia_toc.patch
new file mode 100644
index 0000000..d3decb4
--- /dev/null
+++ b/debian/patches/52_cdparanoia_toc.patch
@@ -0,0 +1,69 @@
+Make the cdparanoia TOC parsing more robust (and clean up the code while
+we're at it). Debian #361164.
+
+
+This is jack 3.1.1 (C)2004 Arne Zellentin <zarne@users.sf.net>
+Traceback (most recent call last):
+ File "/usr/bin/jack", line 134, in ?
+ jack_prepare.filter_tracks(toc_just_read, status)
+ File "/usr/lib/python2.3/site-packages/jack_prepare.py", line 216, in
+filter_tracks
+ ripper_tracks = jack_functions.gettoc(cf['_ripper'])
+ File "/usr/lib/python2.3/site-packages/jack_functions.py", line 125, in
+gettoc exec(jack_helpers.helpers[toc_prog]['toc_fkt'])
+ File "<string>", line 10, in ?
+ValueError: invalid literal for int(): 401: Invalid track number
+
+
+
+diff -urN jack-3.1.1+cvs20050801~/jack_helpers.py jack-3.1.1+cvs20050801/jack_helpers.py
+--- jack-3.1.1+cvs20050801~/jack_helpers.py 2006-04-07 03:58:48.000000000 +0200
++++ jack-3.1.1+cvs20050801/jack_helpers.py 2006-04-07 04:25:28.000000000 +0200
+@@ -297,19 +297,38 @@
+ """,
+ #'toc': 1, # we can't generate correct freedb IDs with cdparanoia.
+ 'toc_cmd': "cdparanoia -d %d -Q 2>&1",
++# The output from cdparanoia which we parse looks like this:
++
++# cdparanoia III release 9.8 (March 23, 2001)
++# (C) 2001 Monty <monty@xiph.org> and Xiphophorus
++# ...
++# track length begin copy pre ch
++# ===========================================================
++# 1. 13584 [03:01.09] 0 [00:00.00] no no 2
++# 2. 13769 [03:03.44] 13584 [03:01.09] no no 2
++# ...
++# TOTAL 121128 [26:55.03] (audio only)
++
++# That is, we look for a line only consisting of === signs as the start,
++# for a line starting with "TOTAL" as the end, and take everything
++# inbetween (to be precise: the first number on each line)
+ 'toc_fkt': r"""
+-while l:
++for l in p.readlines():
+ l = string.rstrip(l)
+- if l and l[0:5] == "TOTAL":
++ if not l:
++ continue
++ if l.startswith("TOTAL"):
+ start = 0
+- if l and l == '=' * (len(l)):
++ elif l == ('=' * len(l)):
+ start = 1
+- elif l and start:
+- l = string.split(l, '.', 1)
+- num = int(l[0])
+- l = string.split(l[1])
+- erg.append([num, int(l[0]), int(l[2]), l[4] == 'OK', l[5] == 'yes', int(l[6]), 1, cf['_bitrate'], cf['_name'] % num])
+- l = p.readline()
++ elif start:
++ l = l.split('.', 1)
++ if l[0].lstrip().isdigit():
++ num = int(l[0])
++ l = l[1].split()
++ erg.append([num, int(l[0]), int(l[2]), l[4] == 'OK', l[5] == 'yes', int(l[6]), 1, cf['_bitrate'], cf['_name'] % num])
++ else:
++ warning("Cannot parse cdrecord TOC line: " + ". ".join(l))
+ """,
+ },
+