static int validate_codec_tag(AVFormatContext *s, AVStream *st)

{

    const AVCodecTag *avctag;

    int n;

    enum AVCodecID id = AV_CODEC_ID_NONE;

    unsigned int tag  = 0;



    /**

     * Check that tag + id is in the table

     * If neither is in the table -> OK

     * If tag is in the table with another id -> FAIL

     * If id is in the table with another tag -> FAIL unless strict < normal

     */

    for (n = 0; s->oformat->codec_tag[n]; n++) {

        avctag = s->oformat->codec_tag[n];

        while (avctag->id != AV_CODEC_ID_NONE) {

            if (avpriv_toupper4(avctag->tag) == avpriv_toupper4(st->codec->codec_tag)) {

                id = avctag->id;

                if (id == st->codec->codec_id)

                    return 1;

            }

            if (avctag->id == st->codec->codec_id)

                tag = avctag->tag;

            avctag++;

        }

    }

    if (id != AV_CODEC_ID_NONE)

        return 0;

    if (tag && (st->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))

        return 0;

    return 1;

}

static int validate_codec_tag(AVFormatContext *s, AVStream *st)

{

    const AVCodecTag *avctag;

    int n;

    enum AVCodecID id = AV_CODEC_ID_NONE;

    unsigned int tag  = 0;



    











    for (n = 0; s->oformat->codec_tag[n]; n++) {

        avctag = s->oformat->codec_tag[n];

        while (avctag->id != AV_CODEC_ID_NONE) {

            if (avpriv_toupper4(avctag->tag) == avpriv_toupper4(st->codec->codec_tag)) {

                id = avctag->id;

                if (id == st->codec->codec_id)

                    return 1;

            }

            if (avctag->id == st->codec->codec_id)

                tag = avctag->tag;

            avctag++;

        }

    }

    if (id != AV_CODEC_ID_NONE)

        return 0;

    if (tag && (st->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))

        return 0;

    return 1;

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1)

{

    const AVCodecTag *VAR_2;

    int VAR_3;

    enum AVCodecID VAR_4 = AV_CODEC_ID_NONE;

    unsigned int VAR_5  = 0;



    











    for (VAR_3 = 0; VAR_0->oformat->codec_tag[VAR_3]; VAR_3++) {

        VAR_2 = VAR_0->oformat->codec_tag[VAR_3];

        while (VAR_2->VAR_4 != AV_CODEC_ID_NONE) {

            if (avpriv_toupper4(VAR_2->VAR_5) == avpriv_toupper4(VAR_1->codec->codec_tag)) {

                VAR_4 = VAR_2->VAR_4;

                if (VAR_4 == VAR_1->codec->codec_id)

                    return 1;

            }

            if (VAR_2->VAR_4 == VAR_1->codec->codec_id)

                VAR_5 = VAR_2->VAR_5;

            VAR_2++;

        }

    }

    if (VAR_4 != AV_CODEC_ID_NONE)

        return 0;

    if (VAR_5 && (VAR_1->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))

        return 0;

    return 1;

}

static int FUNC_0(AVFormatContext *VAR_0, AVStream *VAR_1)
{ const AVCodecTag *VAR_2; int VAR_3; enum AVCodecID VAR_4 = AV_CODEC_ID_NONE; unsigned int VAR_5  = 0; for (VAR_3 = 0; VAR_0->oformat->codec_tag[VAR_3]; VAR_3++) { VAR_2 = VAR_0->oformat->codec_tag[VAR_3]; while (VAR_2->VAR_4 != AV_CODEC_ID_NONE) { if (avpriv_toupper4(VAR_2->VAR_5) == avpriv_toupper4(VAR_1->codec->codec_tag)) { VAR_4 = VAR_2->VAR_4; if (VAR_4 == VAR_1->codec->codec_id)
return 1; } if (VAR_2->VAR_4 == VAR_1->codec->codec_id)
VAR_5 = VAR_2->VAR_5; VAR_2++; } } if (VAR_4 != AV_CODEC_ID_NONE)
return 0; if (VAR_5 && (VAR_1->codec->strict_std_compliance >= FF_COMPLIANCE_NORMAL))
return 0; return 1; }