[FFmpeg-devel] [patch] 6 channel raw audioinputresultsin invalid PCM packet error

Michael Niedermayer michaelni
Sat Nov 8 15:33:58 CET 2008


On Fri, Nov 07, 2008 at 04:30:40PM -0800, Phil Rutschman wrote:
> > > As I explained in my original bug report, pcm_decode_frame in
> > > libavcodec/pcm.c expects the size of the audio packet to be an
> > integer
> > > multiple of the number of channels and the number of bytes per
> > sample.
> > > If it isn't, it reports "invalid PCM packet" and returns with an
> > error.
> > > If the input is mono or stereo 16-bit, it will work because 2 and 4
> > > divide into 1024. Anything with 24-bit audio (3 bytes * number of
> > > channels) or a channel count that isn't a power of two will fail.
> > 
> > AVCodecContext.block_align or bits_per_coded_sample should be useable
> > to simplify this ...
> 
> I added code to print those values in raw_read_packet.
> AVCodecContext.block_align is zero in this case.
> AVCodecContext.bits_per_coded_sample is zero at the time of the first
> call to raw_read_packet. Thus, neither is appropriate.

bits_per_coded_sample could be set in raw_read_header()
it would at least avoid recalculating its value in every packet

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

In fact, the RIAA has been known to suggest that students drop out
of college or go to community college in order to be able to afford
settlements. -- The RIAA
-------------- 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/20081108/17e396ec/attachment.pgp>



More information about the ffmpeg-devel mailing list