Package: mp3cd
Version: 1.25.3-1
Severity: grave
Tags: patch
Justification: renders package unusable

As of version 13, SoX has changed the format of the information
sent to stdout. Because of this, mp3cd fails to parse the information
and no CD can be burnt.
The attached patch should fix this.

-- System Information:
Debian Release: 4.0
  APT prefers unstable
  APT policy: (500, 'unstable')
Architecture: i386 (i686)
Shell:  /bin/sh linked to /bin/bash
Kernel: Linux 2.6.18-4-686
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)

Versions of packages mp3cd depends on:
ii  cdrdao                        1:1.2.2-6  records CDs in Disk-At-Once (DAO) 
ii  libconfig-simple-perl         4.58-1     simple configuration file class
ii  normalize-audio               0.7.7-1    adjust the volume of WAV files to 
ii  perl                          5.8.8-7    Larry Wall's Practical Extraction 
ii  sox                           13.0.0-1   Swiss army knife of sound processi

Versions of packages mp3cd recommends:
pn  flac                          <none>     (no description available)
ii  mpg123                        0.61-5     MPEG layer 1/2/3 audio player
ii  vorbis-tools                  1.1.1-11   several Ogg Vorbis tools

-- no debconf information
--- /usr/bin/mp3cd      2007-03-03 22:12:37.000000000 +0100
+++ mp3cd       2007-03-21 18:49:17.000000000 +0100
@@ -677,17 +677,37 @@
         my $name=shift(@parts);
         print "Checking WAV format for track $name ...\n";
         my $report=`sox -V $wav $wav.raw trim 0.1 1 2>&1`;
-# sox: Reading Wave file: Microsoft PCM format, 2 channels, 44100 samp/sec
-# sox:         176400 byte/sec, 4 block align, 16 bits/samp, 44886528 data 
bytes
-        $report =~ m|(\d+) channels?|s
+
+       `sox -h` =~ /SoX Version (\d+\.\d+\.\d)/;
+       my $sox_version = $1;
+       $sox_version =~ tr/./_/;
+       # In version 13, the format has changed
+       my ($channels, $frequency, $samples);
+       if($sox_version >= 13) {
+         $report =~ m|Channels\s+:\s+(\d+)|s
             or die "sox did not report channel count:\n$report";
-        my $channels = $1;
-        $report =~ m|(\d+) samp/sec|s
+         $channels = $1;
+         $report =~ m|Sample Rate\s+:\s+(\d+)|s
             or die "sox did not report sample frequency:\n$report";
-        my $frequency = $1;
-        $report =~ m|(\d+) bits/samp|s
+         $frequency = $1;
+         $report =~ m|Sample Size\s+:\s+(\d+)-bit|s
             or die "sox did not report sample size:\n$report";
-        my $samples = $1;
+         $samples = $1;
+       } else {
+         # sox: Reading Wave file: Microsoft PCM format, 2 channels,
+         # sox: 44100 samp/sec 176400 byte/sec,  block align, 16 bits/samp,
+         # sox: 44886528 data bytes
+         $report =~ m|(\d+) channels?|s
+            or die "sox did not report channel count:\n$report";
+         $channels = $1;
+         $report =~ m|(\d+) samp/sec|s
+            or die "sox did not report sample frequency:\n$report";
+         $frequency = $1;
+         $report =~ m|(\d+) bits/samp|s
+            or die "sox did not report sample size:\n$report";
+         $samples = $1;
+       }
+
         unless ($channels == 2 &&
                 $frequency == 44100 &&
                 $samples == 16)

Reply via email to