static int mpeg_mux_end(AVFormatContext *ctx)

{

    MpegMuxContext *s = ctx->priv_data;

    StreamInfo *stream;

    int i;



    /* flush each packet */

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

        stream = ctx->streams[i]->priv_data;

        while (stream->buffer_ptr > 0) {

            flush_packet(ctx, i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, s->last_scr);

        }

    }



    /* End header according to MPEG1 systems standard. We do not write

       it as it is usually not needed by decoders and because it

       complicates MPEG stream concatenation. */

    //put_be32(&ctx->pb, ISO_11172_END_CODE);

    //put_flush_packet(&ctx->pb);



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

        av_freep(&ctx->streams[i]->priv_data);



    return 0;

}

static int mpeg_mux_end(AVFormatContext *ctx)

{

    MpegMuxContext *s = ctx->priv_data;

    StreamInfo *stream;

    int i;



    

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

        stream = ctx->streams[i]->priv_data;

        while (stream->buffer_ptr > 0) {

            flush_packet(ctx, i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, s->last_scr);

        }

    }



    





    

    



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

        av_freep(&ctx->streams[i]->priv_data);



    return 0;

}

        while (stream->buffer_ptr > 0) {             flush_packet(ctx, i, AV_NOPTS_VALUE, AV_NOPTS_VALUE, s->last_scr);
static int FUNC_0(AVFormatContext *VAR_0)

{

    MpegMuxContext *s = VAR_0->priv_data;

    StreamInfo *stream;

    int VAR_1;



    

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

        stream = VAR_0->streams[VAR_1]->priv_data;

        while (stream->buffer_ptr > 0) {

            flush_packet(VAR_0, VAR_1, AV_NOPTS_VALUE, AV_NOPTS_VALUE, s->last_scr);

        }

    }



    





    

    



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

        av_freep(&VAR_0->streams[VAR_1]->priv_data);



    return 0;

}

static int FUNC_0(AVFormatContext *VAR_0)
{ MpegMuxContext *s = VAR_0->priv_data; StreamInfo *stream; int VAR_1; for(VAR_1=0;VAR_1<VAR_0->nb_streams;VAR_1++) { stream = VAR_0->streams[VAR_1]->priv_data; while (stream->buffer_ptr > 0) { flush_packet(VAR_0, VAR_1, AV_NOPTS_VALUE, AV_NOPTS_VALUE, s->last_scr); } } for(VAR_1=0;VAR_1<VAR_0->nb_streams;VAR_1++) av_freep(&VAR_0->streams[VAR_1]->priv_data); return 0; }