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

Phil Rutschman philr
Sat Nov 8 01:30:40 CET 2008


> > 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.





More information about the ffmpeg-devel mailing list