int read_ffserver_streams(AVFormatContext *s, const char *filename)

{

    int i;

    AVFormatContext *ic;



    ic = av_open_input_file(filename, FFM_PACKET_SIZE);

    if (!ic)

        return -EIO;

    /* copy stream format */

    s->nb_streams = ic->nb_streams;

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

        AVStream *st;

        st = av_mallocz(sizeof(AVFormatContext));

        memcpy(st, ic->streams[i], sizeof(AVStream));

        s->streams[i] = st;

    }



    av_close_input_file(ic);

    return 0;

}

int read_ffserver_streams(AVFormatContext *s, const char *filename)

{

    int i;

    AVFormatContext *ic;



    ic = av_open_input_file(filename, FFM_PACKET_SIZE);

    if (!ic)

        return -EIO;

    

    s->nb_streams = ic->nb_streams;

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

        AVStream *st;

        st = av_mallocz(sizeof(AVFormatContext));

        memcpy(st, ic->streams[i], sizeof(AVStream));

        s->streams[i] = st;

    }



    av_close_input_file(ic);

    return 0;

}

int FUNC_0(AVFormatContext *VAR_0, const char *VAR_1)

{

    int VAR_2;

    AVFormatContext *ic;



    ic = av_open_input_file(VAR_1, FFM_PACKET_SIZE);

    if (!ic)

        return -EIO;

    

    VAR_0->nb_streams = ic->nb_streams;

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

        AVStream *st;

        st = av_mallocz(sizeof(AVFormatContext));

        memcpy(st, ic->streams[VAR_2], sizeof(AVStream));

        VAR_0->streams[VAR_2] = st;

    }



    av_close_input_file(ic);

    return 0;

}

int FUNC_0(AVFormatContext *VAR_0, const char *VAR_1)
{ int VAR_2; AVFormatContext *ic; ic = av_open_input_file(VAR_1, FFM_PACKET_SIZE); if (!ic)
return -EIO; VAR_0->nb_streams = ic->nb_streams; for(VAR_2=0;VAR_2<ic->nb_streams;VAR_2++) { AVStream *st; st = av_mallocz(sizeof(AVFormatContext)); memcpy(st, ic->streams[VAR_2], sizeof(AVStream)); VAR_0->streams[VAR_2] = st; } av_close_input_file(ic); return 0; }