[FFmpeg-devel] [PATCH] add block_align to sox input

Michael Niedermayer michaelni
Wed Jul 8 03:15:47 CEST 2009


On Tue, Jul 07, 2009 at 03:38:16PM -0700, Phil Rutschman wrote:
> The sox decoder fails when the number of input channels isn't a power of two:
> 
> #create a dummy 6-channel file
> $sox -c 6 -n -t sox foo.sox synth 1 sine 1k
> 
> #attempt to convert to wav
> $ffmpeg -i foo.sox foo.wav
> FFmpeg version git-f338ef2, Copyright (c) 2000-2009 Fabrice Bellard, et al.
>   configuration:
>   libavutil     50. 3. 0 / 50. 3. 0
>   libavcodec    52.32. 0 / 52.32. 0
>   libavformat   52.36. 0 / 52.36. 0
>   libavdevice   52. 2. 0 / 52. 2. 0
>   libswscale     0. 7. 1 /  0. 7. 1
>   built on Jul  7 2009 15:17:20, gcc: 4.3.2
> Input #0, sox, from 'foo.sox':
>   Duration: 00:00:01.00, bitrate: 9215 kb/s
>     Stream #0.0: Audio: pcm_s32le, 48000 Hz, 6 channels, s32, 9216 kb/s
> Output #0, wav, to 'foo.wav':
>     Stream #0.0: Audio: pcm_s16le, 48000 Hz, 6 channels, s16, 4608 kb/s
> Stream mapping:
>   Stream #0.0 -> #0.0
> Press [q] to stop encoding
> Multiple frames in a packet from stream 0
> [pcm_s32le @ 0x26eb690]invalid PCM packet
> Error while decoding stream #0.0
> Multiple frames in a packet from stream 0
> Error while decoding stream #0.0
> Multiple frames in a packet from stream 0
> Error while decoding stream #0.0
> Multiple frames in a packet from stream 0
> Error while decoding stream #0.0
> Multiple frames in a packet from stream 0
> [repeats]
> 
> The attached patch uses st->codec->block_align in soxdec.c based on the changes in this fix:
> http://lists.mplayerhq.hu/pipermail/ffmpeg-cvslog/2009-April/022122.html
> 

Content-Description: sox-block-align.patch
>  soxdec.c |    9 ++++++---
>  1 file changed, 6 insertions(+), 3 deletions(-)
> 626f4b456a47f6b274bd3cfa9380d390ec6e6533  sox-block-align.patch

Iam fine with the patch, assuming its tested

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

Rewriting code that is poorly written but fully understood is good.
Rewriting code that one doesnt understand is a sign that one is less smart
then the original author, trying to rewrite it will not make it better.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090708/144c8d5a/attachment.pgp>



More information about the ffmpeg-devel mailing list