static int swf_write_trailer(AVFormatContext *s)

{

    SWFContext *swf = s->priv_data;

    ByteIOContext *pb = &s->pb;

    AVCodecContext *enc, *video_enc;

    int file_size, i;



    video_enc = NULL;

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

        enc = &s->streams[i]->codec;

        if (enc->codec_type == CODEC_TYPE_VIDEO)

            video_enc = enc;

    }



    put_swf_tag(s, TAG_END);

    put_swf_end_tag(s);

    

    put_flush_packet(&s->pb);



    /* patch file size and number of frames if not streamed */

    if (!url_is_streamed(&s->pb) && video_enc) {

        file_size = url_ftell(pb);

        url_fseek(pb, 4, SEEK_SET);

        put_le32(pb, file_size);

        url_fseek(pb, swf->duration_pos, SEEK_SET);

        put_le16(pb, video_enc->frame_number);

    }

    av_free(swf);

    return 0;

}

static int swf_write_trailer(AVFormatContext *s)

{

    SWFContext *swf = s->priv_data;

    ByteIOContext *pb = &s->pb;

    AVCodecContext *enc, *video_enc;

    int file_size, i;



    video_enc = NULL;

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

        enc = &s->streams[i]->codec;

        if (enc->codec_type == CODEC_TYPE_VIDEO)

            video_enc = enc;

    }



    put_swf_tag(s, TAG_END);

    put_swf_end_tag(s);

    

    put_flush_packet(&s->pb);



    

    if (!url_is_streamed(&s->pb) && video_enc) {

        file_size = url_ftell(pb);

        url_fseek(pb, 4, SEEK_SET);

        put_le32(pb, file_size);

        url_fseek(pb, swf->duration_pos, SEEK_SET);

        put_le16(pb, video_enc->frame_number);

    }

    av_free(swf);

    return 0;

}

    av_free(swf);
static int FUNC_0(AVFormatContext *VAR_0)

{

    SWFContext *swf = VAR_0->priv_data;

    ByteIOContext *pb = &VAR_0->pb;

    AVCodecContext *enc, *video_enc;

    int VAR_1, VAR_2;



    video_enc = NULL;

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

        enc = &VAR_0->streams[VAR_2]->codec;

        if (enc->codec_type == CODEC_TYPE_VIDEO)

            video_enc = enc;

    }



    put_swf_tag(VAR_0, TAG_END);

    put_swf_end_tag(VAR_0);

    

    put_flush_packet(&VAR_0->pb);



    

    if (!url_is_streamed(&VAR_0->pb) && video_enc) {

        VAR_1 = url_ftell(pb);

        url_fseek(pb, 4, SEEK_SET);

        put_le32(pb, VAR_1);

        url_fseek(pb, swf->duration_pos, SEEK_SET);

        put_le16(pb, video_enc->frame_number);

    }

    av_free(swf);

    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0)
{ SWFContext *swf = VAR_0->priv_data; ByteIOContext *pb = &VAR_0->pb; AVCodecContext *enc, *video_enc; int VAR_1, VAR_2; video_enc = NULL; for(VAR_2=0;VAR_2<VAR_0->nb_streams;VAR_2++) { enc = &VAR_0->streams[VAR_2]->codec; if (enc->codec_type == CODEC_TYPE_VIDEO)
video_enc = enc; } put_swf_tag(VAR_0, TAG_END); put_swf_end_tag(VAR_0); put_flush_packet(&VAR_0->pb); if (!url_is_streamed(&VAR_0->pb) && video_enc) { VAR_1 = url_ftell(pb); url_fseek(pb, 4, SEEK_SET); put_le32(pb, VAR_1); url_fseek(pb, swf->duration_pos, SEEK_SET); put_le16(pb, video_enc->frame_number); } av_free(swf); return 0; }