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

Michael Niedermayer michaelni
Fri Nov 7 23:48:33 CET 2008


On Fri, Nov 07, 2008 at 02:10:57PM -0800, Phil Rutschman wrote:
> > > > Index: libavformat/raw.c
> > > >
> ===================================================================
> > > > --- libavformat/raw.c	(revision 15760)
> > > > +++ libavformat/raw.c	(working copy)
> > > > @@ -138,11 +138,17 @@
> > > >
> > > >  static int raw_read_packet(AVFormatContext *s, AVPacket *pkt)  {
> > > > -    int ret, size, bps;
> > > > -    //    AVStream *st = s->streams[0];
> > > > +    int ret, size, bps, sample_size;
> > > > +    AVStream *st = s->streams[0];
> > > >
> > > >      size= RAW_PACKET_SIZE;
> > >
> > > if(channels>0 && channels<20)
> > >     size *= channels;
> > >
> > > seems like a simpler solution
> > 
> > I believe that would fail for 1-channel 24-bit audio since 3 doesn't
> > divide evenly into 1024*1.
> 
> Updated patch to remove the division operation, and just let the packet
> size grow. Added the limit of 20, but pulled it into a #define.

[...]
> +    sample_size = av_get_bits_per_sample(st->codec->codec_id)/8;

why is this needed?

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

Breaking DRM is a little like attempting to break through a door even
though the window is wide open and the only thing in the house is a bunch
of things you dont want and which you would get tomorrow for free anyway
-------------- 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/20081107/e1ac730e/attachment.pgp>



More information about the ffmpeg-devel mailing list