r1631 - in /unstable/toolame/debian: changelog control patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch patches/02-initialize-header-padding-field-before-parsing-arguments.patch

fabian-guest at users.alioth.debian.org fabian-guest at users.alioth.debian.org
Wed Mar 11 11:54:40 UTC 2009


Author: fabian-guest
Date: Wed Mar 11 11:54:40 2009
New Revision: 1631

URL: http://svn.debian.org/wsvn/pkg-multimedia/?sc=1&rev=1631
Log:
Added patch descriptions.
Fixed "binary-control-field-duplicates-source field".


Modified:
    unstable/toolame/debian/changelog
    unstable/toolame/debian/control
    unstable/toolame/debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch
    unstable/toolame/debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch

Modified: unstable/toolame/debian/changelog
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/toolame/debian/changelog?rev=1631&op=diff
==============================================================================
--- unstable/toolame/debian/changelog (original)
+++ unstable/toolame/debian/changelog Wed Mar 11 11:54:40 2009
@@ -1,10 +1,11 @@
-toolame (02l-7) UNRELEASED; urgency=low
+toolame (02l-7) unstable; urgency=low
 
   * debian/control:
     + Added Build-Depends on quilt.
     + Bumped Standards-Version to 3.8.0.
     + Removed the "XS-" prefix from the Vcs-Svn and Vcs-Browser fields.
     + Added Homepage field and removed it from the package description.
+    + Fixed "binary-control-field-duplicates-source field". 
   * debian/rules:
     + Included quilt for patch management.
     + Fixed "debian-rules-ignores-make-clean-error".
@@ -15,7 +16,7 @@
     + New patch to initialize the 1-bit 'header->padding' field before parsing
       the arguments. Thanks Christian Grigis <glove at grigri.org>!
 
- -- Fabian Greffrath <fabian at debian-unofficial.org>  Wed, 19 Nov 2008 10:12:06 +0100
+ -- Fabian Greffrath <fabian at debian-unofficial.org>  Wed, 11 Mar 2009 12:53:11 +0100
 
 toolame (02l-6) unstable; urgency=low
 

Modified: unstable/toolame/debian/control
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/toolame/debian/control?rev=1631&op=diff
==============================================================================
--- unstable/toolame/debian/control (original)
+++ unstable/toolame/debian/control Wed Mar 11 11:54:40 2009
@@ -10,7 +10,6 @@
 Homepage: http://toolame.sourceforge.net/
 
 Package: toolame
-Section: sound
 Architecture: any
 Depends: ${shlibs:Depends}, ${misc:Depends}
 Description: MPEG-1 layer 2 audio encoder

Modified: unstable/toolame/debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/toolame/debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch?rev=1631&op=diff
==============================================================================
--- unstable/toolame/debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch (original)
+++ unstable/toolame/debian/patches/01-WAV-header-read-incorrectly-on-64-bit-platforms.patch Wed Mar 11 11:54:40 2009
@@ -1,3 +1,57 @@
+From: Christian Grigis <glove at grigri.org>
+To: Debian Bug Tracking System <submit at bugs.debian.org>
+Subject: toolame: WAV header read incorrectly on 64-bit platforms
+Date: Sun, 02 Nov 2008 19:28:25 +0100
+
+Package: toolame
+Version: 02l-6
+Severity: important
+Tags: patch
+
+When reading the sample frequency of the WAV header (a 32-bit
+value), a pointer to an "unsigned long" is used on little-endian
+platforms. Unfortunately, "unsigned long" is 64-bit on 64-bit platforms:
+
+% file audio.wav
+audio.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, stereo 48000 Hz
+
+% toolame -s 48 audio.wav
+Parsing Wave File Header
+>>> Unknown samp freq 824633720880000 Hz in Wave Header
+>>> Default 44.1 kHz samp freq selected
+>>> Input Wave File is Stereo
+--------------------------------------------
+Input File : 'audio.wav'   44.1 kHz
+Output File: 'audio.mp2'
+192 kbps MPEG-1 Layer II j-stereo Psy model 1 
+[De-emph:Off	Copyright:No	Original:No	CRC:Off]
+[Padding:Normal	Byte-swap:Off	Chanswap:Off	DAB:Off]
+ATH adjustment 0.000000
+--------------------------------------------
+(...)
+
+(note that 824633720880000 & 0xFFFFFFFF == 48000)
+
+I patched it using a uint32_t to be sure of the length:
+
+% ./toolame-02l/toolame -s 48 audio.wav 
+Parsing Wave File Header
+>>> 48000 Hz sampling freq selected
+>>> Input Wave File is Stereo
+--------------------------------------------
+Input File : 'audio.wav'   48.0 kHz
+Output File: 'audio.mp2'
+192 kbps MPEG-1 Layer II j-stereo Psy model 1 
+[De-emph:Off	Copyright:No	Original:No	CRC:Off]
+[Padding:Normal	Byte-swap:Off	Chanswap:Off	DAB:Off]
+ATH adjustment 0.000000
+--------------------------------------------
+(...)
+
+Best regards,
+
+-Christian
+
 --- toolame-02l.orig/audio_read.c
 +++ toolame-02l/audio_read.c
 @@ -1,6 +1,7 @@

Modified: unstable/toolame/debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch
URL: http://svn.debian.org/wsvn/pkg-multimedia/unstable/toolame/debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch?rev=1631&op=diff
==============================================================================
--- unstable/toolame/debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch (original)
+++ unstable/toolame/debian/patches/02-initialize-header-padding-field-before-parsing-arguments.patch Wed Mar 11 11:54:40 2009
@@ -1,3 +1,97 @@
+From: Christian Grigis <glove at grigri.org>
+To: Debian Bug Tracking System <submit at bugs.debian.org>
+Subject: toolame: Encoded files are sometimes corrupted (bad 'padding' information)
+Date: Wed, 19 Nov 2008 09:41:08 +0100
+
+Package: toolame
+Version: 02l-6
+Severity: important
+Tags: patch
+
+Hello,
+
+When encoding a mono/16-bit/48kHz WAV file, the resulting file is
+sometimes corrupted in the 'padding' information of the headers, which
+renders it unplayable by a decoder:
+
+% file test.wav 
+test.wav: RIFF (little-endian) data, WAVE audio, Microsoft PCM, 16 bit, mono 48000 Hz
+
+% toolame test.wav 
+Parsing Wave File Header
+>>> 48000 Hz sampling freq selected
+>>> Input Wave File is Mono
+--------------------------------------------
+Input File : 'test.wav'   48.0 kHz
+Output File: 'test.mp2'
+192 kbps MPEG-1 Layer II single-ch Psycho model=1  (Mode_Extension=0)
+[De-emph:Off	Copyright:No	Original:No	CRC:Off]
+[Padding:Normal	Byte-swap:Off	Chanswap:Off	DAB:Off]
+ATH adjustment 0.000000
+--------------------------------------------
+encode_init: using tablenum 0 with sblimit 27
+Hit end of audio data
+Avg slots/frame = 576.000; b/smp = 4.00; bitrate = 192.000 kbps
+
+Done
+
+% od -Ax -tx1 test.mp2 | head -1
+000000 ff fd a6 c0 55 68 88 87 77 8d f6 b6 22 00 00 ee
+             ^^
+--> Incorrect (padding is ON)
+
+(...)
+
+% toolame test.wav 
+Parsing Wave File Header
+>>> 48000 Hz sampling freq selected
+>>> Input Wave File is Mono
+--------------------------------------------
+Input File : 'test.wav'   48.0 kHz
+Output File: 'test.mp2'
+192 kbps MPEG-1 Layer II single-ch Psycho model=1  (Mode_Extension=0)
+[De-emph:Off	Copyright:No	Original:No	CRC:Off]
+[Padding:Normal	Byte-swap:Off	Chanswap:Off	DAB:Off]
+ATH adjustment 0.000000
+--------------------------------------------
+encode_init: using tablenum 0 with sblimit 27
+Hit end of audio data
+Avg slots/frame = 576.000; b/smp = 4.00; bitrate = 192.000 kbps
+
+Done
+
+% od -Ax -tx1 test.mp2 | head -1
+000000 ff fd a4 c0 55 68 88 87 77 8d f6 b6 22 00 00 ee
+             ^^
+--> Correct (padding is OFF)
+
+(See for example http://www.mpgedit.org/mpgedit/mpeg_format/mpeghdr.htm
+for the header details.)
+
+Tracking this problem down, it appears that the 1-bit 'header->padding'
+field is not initialized before parsing the arguments, and if no
+argument changes this field, it is left unitialized, resulting in a
+possible corruption.
+
+The attached patch initializes the field to 0 before parsing the
+arguments.
+
+It seems that the problem does not appear with the (more common) 44.1
+kHz sampling rate. My guess, after browsing through the source, is that
+in that case, sizes of packets are such that the encoder has to set the
+padding field for each packet, whereas with 48 kHz, all packets are the
+same size, and the encoder uses the unitialized value throughout the
+whole output file.
+
+By the way, I recently became aware of the 'twolame' package, which
+is a fork of 'toolame'. A quick test with it seems to show that this bug
+(as well as the previous one I reported, #504308) is not present in
+it. Should 'toolame' then be considered obsoleted by 'twolame'?
+
+Thanks and best regards,
+
+-Christian
+
 --- toolame-02l.orig/toolame.c
 +++ toolame-02l/toolame.c
 @@ -644,6 +644,7 @@




More information about the pkg-multimedia-commits mailing list