static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)

{

    int tag = track->enc->codec_tag;



    if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&

                 (tag == MKTAG('d','v','c','p') ||

                  track->enc->codec_id == CODEC_ID_RAWVIDEO ||

                  track->enc->codec_id == CODEC_ID_H263 ||

                  av_get_bits_per_sample(track->enc->codec_id)))) { // pcm audio

        if (track->enc->codec_id == CODEC_ID_DVVIDEO)

            tag = mov_get_dv_codec_tag(s, track);

        else if (track->enc->codec_id == CODEC_ID_RAWVIDEO)

            tag = mov_get_rawvideo_codec_tag(s, track);

        else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {

            tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id);

            if (!tag) { // if no mac fcc found, try with Microsoft tags

                tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id);

                if (tag)

                    av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, "

                           "the file may be unplayable!\n");

            }

        } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {

            tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id);

            if (!tag) { // if no mac fcc found, try with Microsoft tags

                int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id);

                if (ms_tag) {

                    tag = MKTAG('m', 's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));

                    av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, "

                           "the file may be unplayable!\n");

                }

            }

        } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)

            tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id);

    }



    return tag;

}

static int mov_get_codec_tag(AVFormatContext *s, MOVTrack *track)

{

    int tag = track->enc->codec_tag;



    if (!tag || (track->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&

                 (tag == MKTAG('d','v','c','p') ||

                  track->enc->codec_id == CODEC_ID_RAWVIDEO ||

                  track->enc->codec_id == CODEC_ID_H263 ||

                  av_get_bits_per_sample(track->enc->codec_id)))) { 

        if (track->enc->codec_id == CODEC_ID_DVVIDEO)

            tag = mov_get_dv_codec_tag(s, track);

        else if (track->enc->codec_id == CODEC_ID_RAWVIDEO)

            tag = mov_get_rawvideo_codec_tag(s, track);

        else if (track->enc->codec_type == AVMEDIA_TYPE_VIDEO) {

            tag = ff_codec_get_tag(codec_movvideo_tags, track->enc->codec_id);

            if (!tag) { 

                tag = ff_codec_get_tag(ff_codec_bmp_tags, track->enc->codec_id);

                if (tag)

                    av_log(s, AV_LOG_INFO, "Warning, using MS style video codec tag, "

                           "the file may be unplayable!\n");

            }

        } else if (track->enc->codec_type == AVMEDIA_TYPE_AUDIO) {

            tag = ff_codec_get_tag(codec_movaudio_tags, track->enc->codec_id);

            if (!tag) { 

                int ms_tag = ff_codec_get_tag(ff_codec_wav_tags, track->enc->codec_id);

                if (ms_tag) {

                    tag = MKTAG('m', 's', ((ms_tag >> 8) & 0xff), (ms_tag & 0xff));

                    av_log(s, AV_LOG_INFO, "Warning, using MS style audio codec tag, "

                           "the file may be unplayable!\n");

                }

            }

        } else if (track->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)

            tag = ff_codec_get_tag(ff_codec_movsubtitle_tags, track->enc->codec_id);

    }



    return tag;

}

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

{

    int VAR_2 = VAR_1->enc->codec_tag;



    if (!VAR_2 || (VAR_1->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&

                 (VAR_2 == MKTAG('d','v','c','p') ||

                  VAR_1->enc->codec_id == CODEC_ID_RAWVIDEO ||

                  VAR_1->enc->codec_id == CODEC_ID_H263 ||

                  av_get_bits_per_sample(VAR_1->enc->codec_id)))) { 

        if (VAR_1->enc->codec_id == CODEC_ID_DVVIDEO)

            VAR_2 = mov_get_dv_codec_tag(VAR_0, VAR_1);

        else if (VAR_1->enc->codec_id == CODEC_ID_RAWVIDEO)

            VAR_2 = mov_get_rawvideo_codec_tag(VAR_0, VAR_1);

        else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_VIDEO) {

            VAR_2 = ff_codec_get_tag(codec_movvideo_tags, VAR_1->enc->codec_id);

            if (!VAR_2) { 

                VAR_2 = ff_codec_get_tag(ff_codec_bmp_tags, VAR_1->enc->codec_id);

                if (VAR_2)

                    av_log(VAR_0, AV_LOG_INFO, "Warning, using MS style video codec VAR_2, "

                           "the file may be unplayable!\n");

            }

        } else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_AUDIO) {

            VAR_2 = ff_codec_get_tag(codec_movaudio_tags, VAR_1->enc->codec_id);

            if (!VAR_2) { 

                int VAR_3 = ff_codec_get_tag(ff_codec_wav_tags, VAR_1->enc->codec_id);

                if (VAR_3) {

                    VAR_2 = MKTAG('m', 'VAR_0', ((VAR_3 >> 8) & 0xff), (VAR_3 & 0xff));

                    av_log(VAR_0, AV_LOG_INFO, "Warning, using MS style audio codec VAR_2, "

                           "the file may be unplayable!\n");

                }

            }

        } else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_SUBTITLE)

            VAR_2 = ff_codec_get_tag(ff_codec_movsubtitle_tags, VAR_1->enc->codec_id);

    }



    return VAR_2;

}

static int FUNC_0(AVFormatContext *VAR_0, MOVTrack *VAR_1)
{ int VAR_2 = VAR_1->enc->codec_tag; if (!VAR_2 || (VAR_1->enc->strict_std_compliance >= FF_COMPLIANCE_NORMAL &&
(VAR_2 == MKTAG('d','v','c','p') ||
VAR_1->enc->codec_id == CODEC_ID_RAWVIDEO ||
VAR_1->enc->codec_id == CODEC_ID_H263 ||
av_get_bits_per_sample(VAR_1->enc->codec_id)))) { if (VAR_1->enc->codec_id == CODEC_ID_DVVIDEO)
VAR_2 = mov_get_dv_codec_tag(VAR_0, VAR_1); else if (VAR_1->enc->codec_id == CODEC_ID_RAWVIDEO)
VAR_2 = mov_get_rawvideo_codec_tag(VAR_0, VAR_1); else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_VIDEO) { VAR_2 = ff_codec_get_tag(codec_movvideo_tags, VAR_1->enc->codec_id); if (!VAR_2) { VAR_2 = ff_codec_get_tag(ff_codec_bmp_tags, VAR_1->enc->codec_id); if (VAR_2)
av_log(VAR_0, AV_LOG_INFO, "Warning, using MS style video codec VAR_2, "
"the file may be unplayable!\n"); } } else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_AUDIO) { VAR_2 = ff_codec_get_tag(codec_movaudio_tags, VAR_1->enc->codec_id); if (!VAR_2) { int VAR_3 = ff_codec_get_tag(ff_codec_wav_tags, VAR_1->enc->codec_id); if (VAR_3) { VAR_2 = MKTAG('m', 'VAR_0', ((VAR_3 >> 8) & 0xff), (VAR_3 & 0xff)); av_log(VAR_0, AV_LOG_INFO, "Warning, using MS style audio codec VAR_2, "
"the file may be unplayable!\n"); } } } else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) VAR_2 = ff_codec_get_tag(ff_codec_movsubtitle_tags, VAR_1->enc->codec_id); } return VAR_2; }