diff options
author | Martin Storsjö <martin@martin.st> | 2011-02-04 12:04:16 +0200 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-02-06 20:31:44 +0100 |
commit | 4ed68fdfdc19705a09c99b93ec4a54167837a52a (patch) | |
tree | f577cef4ba215d001b50385964ae452c18809711 /libavformat/utils.c | |
parent | 173f19be75a98fbfcf58a7e99871058232dc9dc2 (diff) | |
download | ffmpeg-4ed68fdfdc19705a09c99b93ec4a54167837a52a.tar.gz |
libavformat: Add a function for freeing an AVFormatContext
This function is useful for freeing data structures allocated by
muxers, which currently have to be freed manually by the caller.
Signed-off-by: Ronald S. Bultje <rsbultje@gmail.com>
(cherry picked from commit f124b087eea442b65d809582527dfb5092a3463c)
Diffstat (limited to 'libavformat/utils.c')
-rw-r--r-- | libavformat/utils.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/libavformat/utils.c b/libavformat/utils.c index 6a5c0f066d..d12bbc26c6 100644 --- a/libavformat/utils.c +++ b/libavformat/utils.c @@ -2556,12 +2556,17 @@ int av_read_pause(AVFormatContext *s) void av_close_input_stream(AVFormatContext *s) { - int i; - AVStream *st; - flush_packet_queue(s); if (s->iformat->read_close) s->iformat->read_close(s); + avformat_free_context(s); +} + +void avformat_free_context(AVFormatContext *s) +{ + int i; + AVStream *st; + for(i=0;i<s->nb_streams;i++) { /* free all data in a stream component */ st = s->streams[i]; |