[FFmpeg-devel] [PATCH 3/6] libavformat: Add a function for freeing an AVFormatContext
Michael Niedermayer
michaelni
Thu Feb 3 19:56:39 CET 2011
On Thu, Feb 03, 2011 at 02:32:25PM +0200, Martin Storsj? wrote:
> On Thu, 3 Feb 2011, Anton Khirnov wrote:
>
> > 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.
>
> Good point. Any others in favour of avformat_free_context, or preferring
> any other versions?
iam also in favor of avformat_free_context()
[...]
--
Michael GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB
I am the wisest man alive, for I know one thing, and that is that I know
nothing. -- Socrates
-------------- 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/45bd51ff/attachment.pgp>
More information about the ffmpeg-devel
mailing list