[FFmpeg-devel] [PATCH] Core Audio Format demuxer (v5)

Peter Ross pross
Sun Sep 6 12:57:43 CEST 2009


On Sat, Sep 05, 2009 at 05:13:05AM +0200, Michael Niedermayer wrote:
> On Wed, Aug 26, 2009 at 08:19:26PM +1000, Peter Ross wrote:
> > On Sat, Aug 15, 2009 at 12:08:35PM +0200, Diego Biurrun wrote:
> > > On Sat, Aug 15, 2009 at 05:35:42PM +1000, Peter Ross wrote:
> > > > 
> > > > Revised patch enclosed.
> > > 
> > > .. some nitpicks ..
> > 
> > Ok. Revised patched enclosed.

Next revision of patch enclosed. I have addressed all of Michael's
comments.

> [...]
> > +/** Read audio description chunk */
> > +static int read_desc_chunk(AVFormatContext *s)
> > +{
> > +    ByteIOContext *pb = s->pb;
> > +    CaffContext *caf  = s->priv_data;
> > +    AVStream *st;
> > +    int flags;
> > +
> > +    /* new audio stream */
> > +    st = av_new_stream(s, 0);
> > +    if (!st)
> > +        return AVERROR_NOMEM;
> > +
> > +    /* parse format description */
> > +    st->codec->codec_type  = CODEC_TYPE_AUDIO;
> > +    st->codec->sample_rate = av_int2dbl(get_be64(pb));
> > +    st->codec->codec_tag   = get_be32(pb);
> > +    flags = get_be32(pb);
> > +    caf->bytes_per_packet  = get_be32(pb);
> 
> > +    st->codec->block_align = caf->bytes_per_packet;
> 
> > +    caf->frames_per_packet = get_be32(pb);
> 
> > +    st->codec->channels    = get_be32(pb);
> 
> I think we should have some sanity check for the number of channels
> somewhere because we do multiply by the number of channels in various
> places, its not directly related to your patch of course but a commit
> adding such check at a central place would be welcome

Ok. I have placed some channel validation in libavformat/utils.c.
128 channels outght to be enough for everybody.

-- Peter
(A907 E02F A6E5 0CD2 34CD 20D2 6760 79C5 AC40 DD6B)
-------------- next part --------------
A non-text attachment was scrubbed...
Name: 0001-Core-Audio-Format-demuxer-r6.diff
Type: text/x-diff
Size: 18130 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090906/7baa3932/attachment.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: channel-validate.diff
Type: text/x-diff
Size: 1247 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090906/7baa3932/attachment-0001.diff>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090906/7baa3932/attachment.pgp>



More information about the ffmpeg-devel mailing list