[alsa-devel] [PATCH] hda-analyzer: Make parsing code more robust against future proc file changes
Historically, new additions to the codec proc file has crashed hda-analyzer. With this patch, new additions will instead be ignored.
Signed-off-by: David Henningsson david.henningsson@canonical.com --- hda-analyzer/hda_proc.py | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-)
diff --git a/hda-analyzer/hda_proc.py b/hda-analyzer/hda_proc.py index 3d544c8..10aa662 100644 --- a/hda-analyzer/hda_proc.py +++ b/hda-analyzer/hda_proc.py @@ -644,9 +644,8 @@ class HDACodecProc(HDACodec, HDABaseProc): if line == 'Invalid AFG subtree': print "Invalid AFG subtree for codec %s?" % self.proc_codec_id return - while line.startswith('Power-Map: ') or \ - line.startswith('Analog Loopback: '): - print 'Sigmatel specific "%s" verb ignored for the moment' % line + while not line.startswith('Node '): + print 'Vendor specific "%s" verb ignored at the moment' % line idx += 1 line = lines[idx].strip() node = None @@ -728,7 +727,7 @@ class HDACodecProc(HDACodec, HDABaseProc): elif line.startswith(' Volume-Knob: '): node.add_volknob(line[15:]) else: - self.wrongfile(line) + print 'Node line "%s" ignored at the moment' % line idx += 1 if idx < len(lines): line = lines[idx]
participants (1)
-
David Henningsson