[FFmpeg-devel] [PATCH] Core Audio Format demuxer

Diego Biurrun diego
Mon Aug 10 12:02:23 CEST 2009


On Sun, Aug 09, 2009 at 07:41:05PM +1000, Peter Ross wrote:
> Enclosed is a revised version of Justin Ruggles CAF demuxer.
> 
> --- /dev/null
> +++ b/libavformat/caf.c
> @@ -0,0 +1,70 @@
> +
> +/**
> + * @file caf.c

directory prefix

> --- /dev/null
> +++ b/libavformat/caf.h
> @@ -0,0 +1,29 @@
> +
> +/**
> + * @file caf.h

ditto

This file is missing multiple inclusion guards.

> --- /dev/null
> +++ b/libavformat/cafdec.c
> @@ -0,0 +1,424 @@
> +
> +/**
> + * @file cafdec.c

again

> +#include "avformat.h"
> +#include "riff.h"
> +#include "isom.h"
> +#include <libavutil/intreadwrite.h>

Why are you using <> here?

> +static int probe(AVProbeData *p)
> +{
> +    if(p->buf_size < 6)
> +        return 0;
> +    if(AV_RB32(p->buf) == MKBETAG('c','a','f','f') && AV_RB16(&p->buf[4]) == 1)
> +        return AVPROBE_SCORE_MAX;

K&R please, same below

> +static int read_desc(AVFormatContext *s, int64_t size)
> +{
> +    ByteIOContext *pb = s->pb;
> +    CaffContext *caf = s->priv_data;

align, many more opportunities below

> +static int read_header(AVFormatContext *s,
> +                            AVFormatParameters *ap)

indentation

> +    if(caf->data_size > 0 && caf->bytes_per_packet > 0 &&
> +            caf->frames_per_packet > 0) {

ditto, more below

Diego



More information about the ffmpeg-devel mailing list