[FFmpeg-devel] [PATCH 06/30] avcodec: remove deprecated FF_API_AVCODEC_CLOSE

James Almer jamrial at gmail.com
Mon Feb 24 00:06:06 EET 2025


Deprecated since 2024-02-09.

Signed-off-by: James Almer <jamrial at gmail.com>
---
 libavcodec/avcodec.c       |  8 --------
 libavcodec/avcodec.h       | 18 ------------------
 libavcodec/version_major.h |  1 -
 3 files changed, 27 deletions(-)

diff --git a/libavcodec/avcodec.c b/libavcodec/avcodec.c
index 3f97f5d161..755da184e5 100644
--- a/libavcodec/avcodec.c
+++ b/libavcodec/avcodec.c
@@ -493,14 +493,6 @@ av_cold void ff_codec_close(AVCodecContext *avctx)
     avctx->active_thread_type = 0;
 }
 
-#if FF_API_AVCODEC_CLOSE
-int avcodec_close(AVCodecContext *avctx)
-{
-    ff_codec_close(avctx);
-    return 0;
-}
-#endif
-
 static const char *unknown_if_null(const char *str)
 {
     return str ? str : "unknown";
diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 079e457e4d..5def718fc7 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -2234,24 +2234,6 @@ int avcodec_parameters_to_context(AVCodecContext *codec,
  */
 int avcodec_open2(AVCodecContext *avctx, const AVCodec *codec, AVDictionary **options);
 
-#if FF_API_AVCODEC_CLOSE
-/**
- * Close a given AVCodecContext and free all the data associated with it
- * (but not the AVCodecContext itself).
- *
- * 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.
- *
- * @deprecated 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.
- */
-attribute_deprecated
-int avcodec_close(AVCodecContext *avctx);
-#endif
-
 /**
  * Free all allocated data in the given subtitle struct.
  *
diff --git a/libavcodec/version_major.h b/libavcodec/version_major.h
index b43aa2a2db..38c12650c1 100644
--- a/libavcodec/version_major.h
+++ b/libavcodec/version_major.h
@@ -39,7 +39,6 @@
 
 #define FF_API_INIT_PACKET         (LIBAVCODEC_VERSION_MAJOR < 62)
 
-#define FF_API_AVCODEC_CLOSE       (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_BUFFER_MIN_SIZE     (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_VDPAU_ALLOC_GET_SET (LIBAVCODEC_VERSION_MAJOR < 62)
 #define FF_API_QUALITY_FACTOR      (LIBAVCODEC_VERSION_MAJOR < 62)
-- 
2.48.1



More information about the ffmpeg-devel mailing list