put_le32(pb, file_size);
put_le32(pb, file_size - 8);
static int avi_write_trailer(AVFormatContext *s){    ByteIOContext *pb = &s->pb;    AVIContext *avi = s->priv_data;    offset_t file_size, idx_chunk;    AVIIndex *idx;    if (!url_is_streamed(&s->pb)) {        end_tag(pb, avi->movi_list);        idx_chunk = start_tag(pb, "idx1");        idx = avi->first;        while (idx != NULL) {            put_buffer(pb, idx->tag, 4);            put_le32(pb, idx->flags);            put_le32(pb, idx->pos);            put_le32(pb, idx->len);            idx = idx->next;        }        end_tag(pb, idx_chunk);                /* update file size */        file_size = url_ftell(pb);        url_fseek(pb, 4, SEEK_SET);        put_le32(pb, file_size);        url_fseek(pb, file_size, SEEK_SET);    }    put_flush_packet(pb);    free(avi);    return 0;}