[FFmpeg-cvslog] lavc: make avcodec_init() static on next bump.

Anton Khirnov git at videolan.org
Wed Aug 10 16:53:23 CEST 2011


ffmpeg | branch: master | Anton Khirnov <anton at khirnov.net> | Wed Aug 10 09:50:00 2011 +0200| [7221139ba0486c24afeac1f41ba97c75f58046b9] | committer: Anton Khirnov

lavc: make avcodec_init() static on next bump.

It's called from avcodec_register() anyway, so there's no reason for it
to be public.

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

 libavcodec/avcodec.h |   17 +++++++++--------
 libavcodec/utils.c   |    3 +++
 libavcodec/version.h |    3 +++
 3 files changed, 15 insertions(+), 8 deletions(-)

diff --git a/libavcodec/avcodec.h b/libavcodec/avcodec.h
index 74a60ae..702e775 100644
--- a/libavcodec/avcodec.h
+++ b/libavcodec/avcodec.h
@@ -3482,21 +3482,22 @@ const char *avcodec_configuration(void);
  */
 const char *avcodec_license(void);
 
+#if FF_API_AVCODEC_INIT
 /**
- * Initialize libavcodec.
- * If called more than once, does nothing.
- *
- * @warning This function must be called before any other libavcodec
- * function.
- *
- * @warning This function is not thread-safe.
+ * @deprecated this function is called automatically from avcodec_register()
+ * and avcodec_register_all(), there is no need to call it manually
  */
+attribute_deprecated
 void avcodec_init(void);
+#endif
 
 /**
  * Register the codec codec and initialize libavcodec.
  *
- * @see avcodec_init(), avcodec_register_all()
+ * @warning either this function or avcodec_register_all() must be called
+ * before any other libavcodec functions.
+ *
+ * @see avcodec_register_all()
  */
 void avcodec_register(AVCodec *codec);
 
diff --git a/libavcodec/utils.c b/libavcodec/utils.c
index 32e5251..64f623c 100644
--- a/libavcodec/utils.c
+++ b/libavcodec/utils.c
@@ -1065,6 +1065,9 @@ const char *avcodec_license(void)
     return LICENSE_PREFIX LIBAV_LICENSE + sizeof(LICENSE_PREFIX) - 1;
 }
 
+#if !FF_API_AVCODEC_INIT
+static
+#endif
 void avcodec_init(void)
 {
     static int initialized = 0;
diff --git a/libavcodec/version.h b/libavcodec/version.h
index 24d2488..7eb5ce0 100644
--- a/libavcodec/version.h
+++ b/libavcodec/version.h
@@ -80,5 +80,8 @@
 #ifndef FF_API_VERY_AGGRESSIVE
 #define FF_API_VERY_AGGRESSIVE  (LIBAVCODEC_VERSION_MAJOR < 54)
 #endif
+#ifndef FF_API_AVCODEC_INIT
+#define FF_API_AVCODEC_INIT     (LIBAVCODEC_VERSION_MAJOR < 54)
+#endif
 
 #endif /* AVCODEC_VERSION_H */



More information about the ffmpeg-cvslog mailing list