[FFmpeg-devel] [PATCH v3 09/17] avcodec/codec_internal: nuke init_static_data()

Niklas Haas ffmpeg at haasn.xyz
Fri Aug 30 13:15:32 EEST 2024


From: Niklas Haas <git at haasn.dev>

All hail get_supported_config()
---
 libavcodec/allcodecs.c      | 7 +------
 libavcodec/codec_internal.h | 8 --------
 2 files changed, 1 insertion(+), 14 deletions(-)

diff --git a/libavcodec/allcodecs.c b/libavcodec/allcodecs.c
index 60b1278830..66ea502cf4 100644
--- a/libavcodec/allcodecs.c
+++ b/libavcodec/allcodecs.c
@@ -910,13 +910,8 @@ static AVOnce av_codec_static_init = AV_ONCE_INIT;
 static void av_codec_init_static(void)
 {
     for (int i = 0; codec_list[i]; i++) {
-        const FFCodec *codec = codec_list[i];
-        if (codec->init_static_data) {
-            codec->init_static_data((FFCodec*) codec);
-            continue;
-        }
-
         /* Backward compatibility with deprecated public fields */
+        const FFCodec *codec = codec_list[i];
         if (!codec->get_supported_config)
             continue;
 
diff --git a/libavcodec/codec_internal.h b/libavcodec/codec_internal.h
index 84a4376753..8443c51d71 100644
--- a/libavcodec/codec_internal.h
+++ b/libavcodec/codec_internal.h
@@ -173,14 +173,6 @@ typedef struct FFCodec {
      */
     const FFCodecDefault *defaults;
 
-    /**
-     * Initialize codec static data, called from av_codec_iterate().
-     *
-     * This is not intended for time consuming operations as it is
-     * run for every codec regardless of that codec being used.
-     */
-    void (*init_static_data)(struct FFCodec *codec);
-
     int (*init)(struct AVCodecContext *);
 
     union {
-- 
2.46.0



More information about the ffmpeg-devel mailing list