[FFmpeg-cvslog] r19812 - trunk/libavformat/aea.c
Vitor Sessak
vitor1001
Thu Sep 10 22:40:00 CEST 2009
banan wrote:
> Author: banan
> Date: Thu Sep 10 20:48:12 2009
> New Revision: 19812
>
> Log:
> Initial commit of the MD studio demuxer, not hooked up yet
>
> Added:
> trunk/libavformat/aea.c
>
> Added: trunk/libavformat/aea.c
> ==============================================================================
> --- /dev/null 00:00:00 1970 (empty, because file is newly added)
> +++ trunk/libavformat/aea.c Thu Sep 10 20:48:12 2009 (r19812)
> @@ -0,0 +1,110 @@
> +/*
> + * MD STUDIO audio demuxer
> + *
> + * Copyright (c) 2009 Benjamin Larsson
> + *
> + * This file is part of FFmpeg.
> + *
> + * FFmpeg is free software; you can redistribute it and/or
> + * modify it under the terms of the GNU Lesser General Public
> + * License as published by the Free Software Foundation; either
> + * version 2.1 of the License, or (at your option) any later version.
> + *
> + * FFmpeg is distributed in the hope that it will be useful,
> + * but WITHOUT ANY WARRANTY; without even the implied warranty of
> + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
> + * Lesser General Public License for more details.
> + *
> + * You should have received a copy of the GNU Lesser General Public
> + * License along with FFmpeg; if not, write to the Free Software
> + * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
> + */
> +
> +/**
> + * @file libavformat/aea.c
> + */
> +
> +#include "avformat.h"
> +#include "raw.h"
> +#include "libavutil/intreadwrite.h"
> +
> +#define AT1_SU_SIZE 212
> +
> +static int aea_read_probe(AVProbeData *p)
> +{
> + if (p->buf_size <= 2048+212)
> + return 0;
> +
> + /* Magic is '00 08 00 00' in Little Endian*/
> + if(AV_RL32(p->buf)==0x800) {
> + int bsm_s, bsm_e, inb_s, inb_e;
> + bsm_s = p->buf[2048];
> + inb_s = p->buf[2048+1];
> + inb_e = p->buf[2048+210];
> + bsm_e = p->buf[2048+211];
> +
> +
> + /* Check so that the redundant bsm bytes and info bytes are valid
> + * the block size mode bytes have to be the same
> + * the info bytes have to be the same
> + * the block size mode and info byte can't be the same
> + */
> + if (bsm_s == bsm_e && inb_s == inb_e && bsm_s != inb_s)
> + return AVPROBE_SCORE_MAX/2;
Maybe this can be improved by checking the sanity of the number of channels
-Vitor
More information about the ffmpeg-cvslog
mailing list