diff options
author | Martin Storsjö <martin@martin.st> | 2011-02-04 12:04:16 +0200 |
---|---|---|
committer | Ronald S. Bultje <rsbultje@gmail.com> | 2011-02-04 11:29:41 -0500 |
commit | f124b087eea442b65d809582527dfb5092a3463c (patch) | |
tree | 6e6dcd28660d2d0c6d22ec41e97b8c372053b801 /libavformat/utils.c | |
parent | 1338dc082354b87c0e26f7f2ab09df5964b7f993 (diff) | |
download | ffmpeg-f124b087eea442b65d809582527dfb5092a3463c.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>
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]; |