[FFmpeg-devel] [PATCH 3/6] libavformat: Add a function for freeing an AVFormatContext

Anton Khirnov anton
Thu Feb 3 13:22:33 CET 2011


On Thu, Feb 03, 2011 at 02:10:14PM +0200, Martin Storsj? wrote:
> This function is useful for freeing data structures allocated by
> muxers, which currently have to be freed manually by the caller.
> ---
>  libavformat/avformat.h |    6 ++++++
>  libavformat/utils.c    |   11 ++++++++---
>  2 files changed, 14 insertions(+), 3 deletions(-)
> 
> diff --git a/libavformat/avformat.h b/libavformat/avformat.h
> index f9f9be5..1cbe274 100644
> --- a/libavformat/avformat.h
> +++ b/libavformat/avformat.h
> @@ -1230,6 +1230,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 av_free_context(AVFormatContext *s);
> +
I think avformat_free_context would be a better name, because:
1) it's consistent with existing avformat_alloc_context
2) av_free_context doesn't tell you that you're freeing a _format_
context; it might also conflict with future similar functions in
lavc and friends.

-- 
Anton Khirnov
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20110203/7a501768/attachment.pgp>



More information about the ffmpeg-devel mailing list