Mercurial > libavformat.hg
comparison utils.c @ 2835:b158768c5352 libavformat
Add a av_close_input_stream function
author | reimar |
---|---|
date | Wed, 19 Dec 2007 14:07:13 +0000 |
parents | 8ac5fe1c5549 |
children | b51319dd86e5 |
comparison
equal
deleted
inserted
replaced
2834:63fda6ba2173 | 2835:b158768c5352 |
---|---|
2054 if (s->pb && s->pb->read_pause) | 2054 if (s->pb && s->pb->read_pause) |
2055 return av_url_read_fpause(s->pb); | 2055 return av_url_read_fpause(s->pb); |
2056 return AVERROR(ENOSYS); | 2056 return AVERROR(ENOSYS); |
2057 } | 2057 } |
2058 | 2058 |
2059 void av_close_input_file(AVFormatContext *s) | 2059 void av_close_input_stream(AVFormatContext *s) |
2060 { | 2060 { |
2061 int i; | 2061 int i; |
2062 AVStream *st; | 2062 AVStream *st; |
2063 | 2063 |
2064 /* free previous packet */ | 2064 /* free previous packet */ |
2083 av_freep(&s->programs[i]->name); | 2083 av_freep(&s->programs[i]->name); |
2084 av_freep(&s->programs[i]->stream_index); | 2084 av_freep(&s->programs[i]->stream_index); |
2085 av_freep(&s->programs[i]); | 2085 av_freep(&s->programs[i]); |
2086 } | 2086 } |
2087 flush_packet_queue(s); | 2087 flush_packet_queue(s); |
2088 if (!(s->iformat->flags & AVFMT_NOFILE)) | |
2089 url_fclose(s->pb); | |
2090 av_freep(&s->priv_data); | 2088 av_freep(&s->priv_data); |
2091 av_free(s); | 2089 av_free(s); |
2090 } | |
2091 | |
2092 void av_close_input_file(AVFormatContext *s) | |
2093 { | |
2094 ByteIOContext *pb = s->iformat->flags & AVFMT_NOFILE ? NULL : s->pb; | |
2095 av_close_input_stream(s); | |
2096 if (pb) | |
2097 url_fclose(pb); | |
2092 } | 2098 } |
2093 | 2099 |
2094 AVStream *av_new_stream(AVFormatContext *s, int id) | 2100 AVStream *av_new_stream(AVFormatContext *s, int id) |
2095 { | 2101 { |
2096 AVStream *st; | 2102 AVStream *st; |