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

Phil Rutschman philr
Fri Nov 7 23:10:57 CET 2008


> > > 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.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: raw_audio_6_channels-v2.diff
Type: application/octet-stream
Size: 783 bytes
Desc: raw_audio_6_channels-v2.diff
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081107/e45be2e4/attachment.obj>



More information about the ffmpeg-devel mailing list