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/avformat.h | |
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/avformat.h')
-rw-r--r-- | libavformat/avformat.h | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h index 82991c15dc..6215ca59ee 100644 --- a/libavformat/avformat.h +++ b/libavformat/avformat.h @@ -1074,8 +1074,8 @@ attribute_deprecated AVFormatContext *av_alloc_format_context(void); /** * Allocate an AVFormatContext. - * Can be freed with av_free() but do not forget to free everything you - * explicitly allocated as well! + * avformat_free_context() can be used to free the context and everything + * allocated by the framework within it. */ AVFormatContext *avformat_alloc_context(void); @@ -1232,6 +1232,12 @@ void av_close_input_stream(AVFormatContext *s); void av_close_input_file(AVFormatContext *s); /** + * Free an AVFormatContext and all its streams. + * @param s context to free + */ +void avformat_free_context(AVFormatContext *s); + +/** * Add a new stream to a media file. * * Can only be called in the read_header() function. If the flag |