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

Michael Niedermayer michaelni
Sat Nov 8 01:16:23 CET 2008


On Fri, Nov 07, 2008 at 02:58:45PM -0800, Phil Rutschman wrote:
> > [...]
> > > +    sample_size = av_get_bits_per_sample(st->codec->codec_id)/8;
> > 
> > why is this needed?
> 
> 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 ...

[...]

-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

I have often repented speaking, but never of holding my tongue.
-- Xenocrates
-------------- 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/8296f2c8/attachment.pgp>



More information about the ffmpeg-devel mailing list