[Ffmpeg-cvslog] r7593 - in trunk/libavformat: aiff.c asf-enc.c au.c avformat.h avienc.c flvenc.c gxfenc.c isom.c isom.h libnut.c mov.c movenc.c nsvdec.c riff.c riff.h swf.c voc.c voc.h wav.c

Reimar Döffinger Reimar.Doeffinger
Sun Jan 21 11:27:21 CET 2007


Hello,
On Sun, Jan 21, 2007 at 02:39:19AM +0100, michael wrote:
> +    /**
> +     * list of supported codec_id-codec_tag pairs, ordered by "better choice first"
> +     * the arrays are all CODEC_ID_NONE terminated
> +     */
> +    const struct AVCodecTag *codec_tag[4];

If they are all "CODEC_ID_NONE terminated"

> +unsigned int av_codec_get_tag(const AVCodecTag *tags[4], enum CodecID id)
> +{
> +    int i;
> +    for(i=0; i<4 && tags[i]; i++){
> +        int tag= codec_get_tag(tags[i], id);
> +        if(tag) return tag;
> +    }
> +    return 0;
> +}
> +
> +enum CodecID av_codec_get_id(const AVCodecTag *tags[4], unsigned int tag)
> +{
> +    int i;
> +    for(i=0; i<4 && tags[i]; i++){
> +        enum CodecID id= codec_get_id(tags[i], tag);
> +        if(id!=CODEC_ID_NONE) return id;
> +    }
> +    return CODEC_ID_NONE;
> +}

Then what is the point of arbitrarily restricting these to a maximum of
4 entries?
IMO that's just a PITA both if we either realize that the [4] in the
struct above is not enough or some external app wants to provide more
mappings.

Greetings,
Reimar D?ffinger




More information about the ffmpeg-cvslog mailing list