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

{

    int64_t pos = avio_tell(pb);

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

    ffio_wfourcc(pb, "stbl");

    mov_write_stsd_tag(pb, track);

    mov_write_stts_tag(pb, track);

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

         track->enc->codec_tag == MKTAG('r','t','p',' ')) &&

        track->has_keyframes && track->has_keyframes < track->entry)

        mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE);

    if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS)

        mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);

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

        track->flags & MOV_TRACK_CTTS && track->entry)

        mov_write_ctts_tag(pb, track);

    mov_write_stsc_tag(pb, track);

    mov_write_stsz_tag(pb, track);

    mov_write_stco_tag(pb, track);

    return update_size(pb, pos);

}

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

{

    int64_t pos = avio_tell(pb);

    avio_wb32(pb, 0); 

    ffio_wfourcc(pb, "stbl");

    mov_write_stsd_tag(pb, track);

    mov_write_stts_tag(pb, track);

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

         track->enc->codec_tag == MKTAG('r','t','p',' ')) &&

        track->has_keyframes && track->has_keyframes < track->entry)

        mov_write_stss_tag(pb, track, MOV_SYNC_SAMPLE);

    if (track->mode == MODE_MOV && track->flags & MOV_TRACK_STPS)

        mov_write_stss_tag(pb, track, MOV_PARTIAL_SYNC_SAMPLE);

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

        track->flags & MOV_TRACK_CTTS && track->entry)

        mov_write_ctts_tag(pb, track);

    mov_write_stsc_tag(pb, track);

    mov_write_stsz_tag(pb, track);

    mov_write_stco_tag(pb, track);

    return update_size(pb, pos);

}

        track->flags & MOV_TRACK_CTTS && track->entry)         mov_write_ctts_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, "stbl");

    mov_write_stsd_tag(VAR_0, VAR_1);

    mov_write_stts_tag(VAR_0, VAR_1);

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

         VAR_1->enc->codec_tag == MKTAG('r','t','p',' ')) &&

        VAR_1->has_keyframes && VAR_1->has_keyframes < VAR_1->entry)

        mov_write_stss_tag(VAR_0, VAR_1, MOV_SYNC_SAMPLE);

    if (VAR_1->mode == MODE_MOV && VAR_1->flags & MOV_TRACK_STPS)

        mov_write_stss_tag(VAR_0, VAR_1, MOV_PARTIAL_SYNC_SAMPLE);

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

        VAR_1->flags & MOV_TRACK_CTTS && VAR_1->entry)

        mov_write_ctts_tag(VAR_0, VAR_1);

    mov_write_stsc_tag(VAR_0, VAR_1);

    mov_write_stsz_tag(VAR_0, VAR_1);

    mov_write_stco_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, "stbl"); mov_write_stsd_tag(VAR_0, VAR_1); mov_write_stts_tag(VAR_0, VAR_1); if ((VAR_1->enc->codec_type == AVMEDIA_TYPE_VIDEO ||
VAR_1->enc->codec_tag == MKTAG('r','t','p',' ')) &&
VAR_1->has_keyframes && VAR_1->has_keyframes < VAR_1->entry)
mov_write_stss_tag(VAR_0, VAR_1, MOV_SYNC_SAMPLE); if (VAR_1->mode == MODE_MOV && VAR_1->flags & MOV_TRACK_STPS)
mov_write_stss_tag(VAR_0, VAR_1, MOV_PARTIAL_SYNC_SAMPLE); if (VAR_1->enc->codec_type == AVMEDIA_TYPE_VIDEO &&
VAR_1->flags & MOV_TRACK_CTTS && VAR_1->entry)
mov_write_ctts_tag(VAR_0, VAR_1); mov_write_stsc_tag(VAR_0, VAR_1); mov_write_stsz_tag(VAR_0, VAR_1); mov_write_stco_tag(VAR_0, VAR_1); return update_size(VAR_0, pos); }