static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)

{

    int64_t pos = avio_tell(pb);

    avio_wb32(pb, 0); /* size */

    ffio_wfourcc(pb, "minf");

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

        mov_write_vmhd_tag(pb);

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

        mov_write_smhd_tag(pb);

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

        if (track->tag == MKTAG('t','e','x','t') || is_clcp_track(track)) {

            mov_write_gmhd_tag(pb, track);

        } else {

            mov_write_nmhd_tag(pb);

        }

    } else if (track->tag == MKTAG('r','t','p',' ')) {

        mov_write_hmhd_tag(pb);

    } else if (track->tag == MKTAG('t','m','c','d')) {

        mov_write_gmhd_tag(pb, track);

    }

    if (track->mode == MODE_MOV) /* FIXME: Why do it for MODE_MOV only ? */

        mov_write_hdlr_tag(pb, NULL);

    mov_write_dinf_tag(pb);

    mov_write_stbl_tag(pb, track);

    return update_size(pb, pos);

}

static int mov_write_minf_tag(AVIOContext *pb, MOVTrack *track)

{

    int64_t pos = avio_tell(pb);

    avio_wb32(pb, 0); 

    ffio_wfourcc(pb, "minf");

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

        mov_write_vmhd_tag(pb);

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

        mov_write_smhd_tag(pb);

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

        if (track->tag == MKTAG('t','e','x','t') || is_clcp_track(track)) {

            mov_write_gmhd_tag(pb, track);

        } else {

            mov_write_nmhd_tag(pb);

        }

    } else if (track->tag == MKTAG('r','t','p',' ')) {

        mov_write_hmhd_tag(pb);

    } else if (track->tag == MKTAG('t','m','c','d')) {

        mov_write_gmhd_tag(pb, track);

    }

    if (track->mode == MODE_MOV) 

        mov_write_hdlr_tag(pb, NULL);

    mov_write_dinf_tag(pb);

    mov_write_stbl_tag(pb, track);

    return update_size(pb, pos);

}

    mov_write_stbl_tag(pb, track);
static int FUNC_0(AVIOContext *VAR_0, MOVTrack *VAR_1)

{

    int64_t pos = avio_tell(VAR_0);

    avio_wb32(VAR_0, 0); 

    ffio_wfourcc(VAR_0, "minf");

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

        mov_write_vmhd_tag(VAR_0);

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

        mov_write_smhd_tag(VAR_0);

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

        if (VAR_1->tag == MKTAG('t','e','x','t') || is_clcp_track(VAR_1)) {

            mov_write_gmhd_tag(VAR_0, VAR_1);

        } else {

            mov_write_nmhd_tag(VAR_0);

        }

    } else if (VAR_1->tag == MKTAG('r','t','p',' ')) {

        mov_write_hmhd_tag(VAR_0);

    } else if (VAR_1->tag == MKTAG('t','m','c','d')) {

        mov_write_gmhd_tag(VAR_0, VAR_1);

    }

    if (VAR_1->mode == MODE_MOV) 

        mov_write_hdlr_tag(VAR_0, NULL);

    mov_write_dinf_tag(VAR_0);

    mov_write_stbl_tag(VAR_0, VAR_1);

    return update_size(VAR_0, pos);

}

static int FUNC_0(AVIOContext *VAR_0, MOVTrack *VAR_1)
{ int64_t pos = avio_tell(VAR_0); avio_wb32(VAR_0, 0); ffio_wfourcc(VAR_0, "minf"); if (VAR_1->enc->codec_type == AVMEDIA_TYPE_VIDEO)
mov_write_vmhd_tag(VAR_0); else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_AUDIO)
mov_write_smhd_tag(VAR_0); else if (VAR_1->enc->codec_type == AVMEDIA_TYPE_SUBTITLE) { if (VAR_1->tag == MKTAG('t','e','x','t') || is_clcp_track(VAR_1)) { mov_write_gmhd_tag(VAR_0, VAR_1); } else { mov_write_nmhd_tag(VAR_0); } } else if (VAR_1->tag == MKTAG('r','t','p',' ')) { mov_write_hmhd_tag(VAR_0); } else if (VAR_1->tag == MKTAG('t','m','c','d')) { mov_write_gmhd_tag(VAR_0, VAR_1); } if (VAR_1->mode == MODE_MOV)
mov_write_hdlr_tag(VAR_0, NULL); mov_write_dinf_tag(VAR_0); mov_write_stbl_tag(VAR_0, VAR_1); return update_size(VAR_0, pos); }