if (!url_is_streamed(pb)) { INT64 size;  size = url_ftell(pb); url_fseek(pb, 8, SEEK_SET); put_be64(pb, size); put_flush_packet(pb); }
static int ffm_write_trailer(AVFormatContext *s){    ByteIOContext *pb = &s->pb;    FFMContext *ffm = s->priv_data;    int i;    /* flush packets */    if (ffm->packet_ptr > ffm->packet)        flush_packet(s);    put_flush_packet(pb);    for(i=0;i<s->nb_streams;i++)        av_freep(&s->streams[i]->priv_data);    return 0;}