static int mov_write_identification(AVIOContext *pb, AVFormatContext *s)

{

    MOVMuxContext *mov = s->priv_data;

    int i;



    mov_write_ftyp_tag(pb,s);

    if (mov->mode == MODE_PSP) {

        int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;

        for (i = 0; i < s->nb_streams; i++) {

            AVStream *st = s->streams[i];

            if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)

                video_streams_nb++;

            else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)

                audio_streams_nb++;

            else

                other_streams_nb++;

            }



        if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {

            av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");

            return AVERROR(EINVAL);

        }

        mov_write_uuidprof_tag(pb, s);

    }

    return 0;

}

static int mov_write_identification(AVIOContext *pb, AVFormatContext *s)

{

    MOVMuxContext *mov = s->priv_data;

    int i;



    mov_write_ftyp_tag(pb,s);

    if (mov->mode == MODE_PSP) {

        int video_streams_nb = 0, audio_streams_nb = 0, other_streams_nb = 0;

        for (i = 0; i < s->nb_streams; i++) {

            AVStream *st = s->streams[i];

            if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)

                video_streams_nb++;

            else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)

                audio_streams_nb++;

            else

                other_streams_nb++;

            }



        if (video_streams_nb != 1 || audio_streams_nb != 1 || other_streams_nb) {

            av_log(s, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");

            return AVERROR(EINVAL);

        }

        mov_write_uuidprof_tag(pb, s);

    }

    return 0;

}

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

{

    MOVMuxContext *mov = VAR_1->priv_data;

    int VAR_2;



    mov_write_ftyp_tag(VAR_0,VAR_1);

    if (mov->mode == MODE_PSP) {

        int VAR_3 = 0, VAR_4 = 0, VAR_5 = 0;

        for (VAR_2 = 0; VAR_2 < VAR_1->nb_streams; VAR_2++) {

            AVStream *st = VAR_1->streams[VAR_2];

            if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)

                VAR_3++;

            else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)

                VAR_4++;

            else

                VAR_5++;

            }



        if (VAR_3 != 1 || VAR_4 != 1 || VAR_5) {

            av_log(VAR_1, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n");

            return AVERROR(EINVAL);

        }

        mov_write_uuidprof_tag(VAR_0, VAR_1);

    }

    return 0;

}

static int FUNC_0(AVIOContext *VAR_0, AVFormatContext *VAR_1)
{ MOVMuxContext *mov = VAR_1->priv_data; int VAR_2; mov_write_ftyp_tag(VAR_0,VAR_1); if (mov->mode == MODE_PSP) { int VAR_3 = 0, VAR_4 = 0, VAR_5 = 0; for (VAR_2 = 0; VAR_2 < VAR_1->nb_streams; VAR_2++) { AVStream *st = VAR_1->streams[VAR_2]; if (st->codecpar->codec_type == AVMEDIA_TYPE_VIDEO)
VAR_3++; else if (st->codecpar->codec_type == AVMEDIA_TYPE_AUDIO)
VAR_4++; else
VAR_5++; } if (VAR_3 != 1 || VAR_4 != 1 || VAR_5) { av_log(VAR_1, AV_LOG_ERROR, "PSP mode need one video and one audio stream\n"); return AVERROR(EINVAL); } mov_write_uuidprof_tag(VAR_0, VAR_1); } return 0; }