[FFmpeg-devel] [PATCH 2/2] ADP demuxer

James Almer jamrial at gmail.com
Sat Apr 20 21:27:24 CEST 2013


On 20/04/13 12:03 AM, James Almer wrote:
> diff --git a/libavformat/adp.c b/libavformat/adp.c
> new file mode 100644
> index 0000000..398f2b6
> --- /dev/null
> +++ b/libavformat/adp.c
> @@ -0,0 +1,86 @@
> +/*
> + * ADP demuxer
> + * Copyright (c) 2013 James Almer
> + *
> + * 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
> + */
> +
> +#include "libavutil/channel_layout.h"
> +#include "libavutil/intreadwrite.h"
> +#include "avformat.h"
> +#include "internal.h"
> +
> +typedef struct ADPDemuxContext {
> +    int64_t    filesize;
> +} ADPDemuxContext;
> +
> +static int adp_probe(AVProbeData *p)
> +{
> +    if (p->buf[0] == p->buf[2] && p->buf[1] == p->buf[3])
> +        return AVPROBE_SCORE_MAX / 3;
> +    return 0;
> +}

I just noticed this breaks fate-tiertex-seq because the probe for both formats is 
similar, and i made this decoder return a higher score than tiertex.

I think making tiertex return "AVPROBE_SCORE_MAX / 3" and adp "AVPROBE_SCORE_MAX / 4"
is the best solution, since afaik there's no way to improve the probe for either of
them (Both are headerless containers), but I'm open for suggestions.

Regards.


More information about the ffmpeg-devel mailing list