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

Phil Rutschman phil.rutschman
Wed Jul 8 00:38:16 CEST 2009


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

-------------- next part --------------
A non-text attachment was scrubbed...
Name: sox-block-align.patch
Type: application/octet-stream
Size: 1098 bytes
Desc: sox-block-align.patch
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090707/b199139a/attachment.obj>



More information about the ffmpeg-devel mailing list