void av_close_input_file(AVFormatContext *s)

{

    int i;



    if (s->iformat->read_close)

        s->iformat->read_close(s);

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

        av_free(s->streams[i]);

    }

    if (s->packet_buffer) {

        AVPacketList *p, *p1;

        p = s->packet_buffer;

        while (p != NULL) {

            p1 = p->next;

            av_free_packet(&p->pkt);

            av_free(p);

            p = p1;

        }

        s->packet_buffer = NULL;

    }

    if (!(s->iformat->flags & AVFMT_NOFILE)) {

        url_fclose(&s->pb);

    }

    av_free(s->priv_data);

    av_free(s);

}

void av_close_input_file(AVFormatContext *s)

{

    int i;



    if (s->iformat->read_close)

        s->iformat->read_close(s);

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

        av_free(s->streams[i]);

    }

    if (s->packet_buffer) {

        AVPacketList *p, *p1;

        p = s->packet_buffer;

        while (p != NULL) {

            p1 = p->next;

            av_free_packet(&p->pkt);

            av_free(p);

            p = p1;

        }

        s->packet_buffer = NULL;

    }

    if (!(s->iformat->flags & AVFMT_NOFILE)) {

        url_fclose(&s->pb);

    }

    av_free(s->priv_data);

    av_free(s);

}

void FUNC_0(AVFormatContext *VAR_0)

{

    int VAR_1;



    if (VAR_0->iformat->read_close)

        VAR_0->iformat->read_close(VAR_0);

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

        av_free(VAR_0->streams[VAR_1]);

    }

    if (VAR_0->packet_buffer) {

        AVPacketList *p, *p1;

        p = VAR_0->packet_buffer;

        while (p != NULL) {

            p1 = p->next;

            av_free_packet(&p->pkt);

            av_free(p);

            p = p1;

        }

        VAR_0->packet_buffer = NULL;

    }

    if (!(VAR_0->iformat->flags & AVFMT_NOFILE)) {

        url_fclose(&VAR_0->pb);

    }

    av_free(VAR_0->priv_data);

    av_free(VAR_0);

}

void FUNC_0(AVFormatContext *VAR_0)
{ int VAR_1; if (VAR_0->iformat->read_close)
VAR_0->iformat->read_close(VAR_0); for(VAR_1=0;VAR_1<VAR_0->nb_streams;VAR_1++) { av_free(VAR_0->streams[VAR_1]); } if (VAR_0->packet_buffer) { AVPacketList *p, *p1; p = VAR_0->packet_buffer; while (p != NULL) { p1 = p->next; av_free_packet(&p->pkt); av_free(p); p = p1; } VAR_0->packet_buffer = NULL; } if (!(VAR_0->iformat->flags & AVFMT_NOFILE)) { url_fclose(&VAR_0->pb); } av_free(VAR_0->priv_data); av_free(VAR_0); }