[FFmpeg-devel] [PATCH] AU : demuxed packet size should be sample size aligned
Jai Menon
jmenon86
Mon Dec 7 05:15:47 CET 2009
On Sun, Dec 06, 2009 at 10:35:39PM +0100, Michael Niedermayer wrote:
> nOn Sun, Dec 06, 2009 at 11:26:58PM +0530, Jai Menon wrote:
> > Hi,
> >
> > As in subject.
> > Fixes issue 1593.
> >
> > --
> > Jai Menon
> >
>
> > au.c | 4 ++--
> > 1 file changed, 2 insertions(+), 2 deletions(-)
> > b6deb93d2a729411da7182658cfd362c573bfb29 audemux_fix.patch
> > diff --git a/libavformat/au.c b/libavformat/au.c
> > index 7f119e9..e4f5d9e 100644
> > --- a/libavformat/au.c
> > +++ b/libavformat/au.c
> > @@ -157,14 +157,14 @@ static int au_read_header(AVFormatContext *s,
> > return 0;
> > }
> >
> > -#define MAX_SIZE 4096
> > +#define BLOCK_SIZE 2048
> >
> > static int au_read_packet(AVFormatContext *s,
> > AVPacket *pkt)
> > {
> > int ret;
> >
> > - ret= av_get_packet(s->pb, pkt, MAX_SIZE);
> > + ret= av_get_packet(s->pb, pkt, BLOCK_SIZE*av_get_bits_per_sample(s->streams[0]->codec->codec_id)>>3);
>
> i suspect this also needs to be multiplied by channels
The opengroup spec doesn't say much about odd no. of channels but for
completeness sake, updated patch attached.
--
Jai Menon
-------------- next part --------------
A non-text attachment was scrubbed...
Name: audemux_fix.patch
Type: text/x-patch
Size: 677 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20091207/8b3de230/attachment.bin>
More information about the ffmpeg-devel
mailing list