[FFmpeg-cvslog] lavc: document that avcodec_close() should not be used

Anton Khirnov git at videolan.org
Sun Jun 26 20:23:44 CEST 2016


ffmpeg | branch: release/3.1 | Anton Khirnov <anton at khirnov.net> | Sat May 21 12:05:38 2016 +0200| [2ef6dab0a79a9852a92ed80b07f9e32a37530d9e] | committer: Anton Khirnov

lavc: document that avcodec_close() should not be used

We cannot deprecate it until the new parser API is in place, because of
the way libavformat works. But the majority of the users can already
simply replace it with avcodec_free_context(), which will simplify the
transition once it is finally deprecated.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=2ef6dab0a79a9852a92ed80b07f9e32a37530d9e
---

 libavcodec/avcodec.h |    5 +++++
 1 file changed, 5 insertions(+)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 24cf39f..dc6649a 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3756,6 +3756,11 @@ int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **op
  * Calling this function on an AVCodecContext that hasn't been opened will free
  * the codec-specific data allocated in avcodec_alloc_context3() with a non-NULL
  * codec. Subsequent calls will do nothing.
+ *
+ * @note Do not use this function. Use avcodec_free_context() to destroy a
+ * codec context (either open or closed). Opening and closing a codec context
+ * multiple times is not supported anymore -- use multiple codec contexts
+ * instead.
  */
 int avcodec_close(AVCodecContext *avctx);
 



More information about the ffmpeg-cvslog mailing list