[FFmpeg-devel] [PATCH] remove INIT_VLC_USE_STATIC

Reimar Döffinger Reimar.Doeffinger
Thu Sep 24 12:03:55 CEST 2009


To be applied after my three other patches related to this.
I think there is also a roundup bug about this open, I don't remember
its number though.
Index: libavcodec/get_bits.h
===================================================================
--- libavcodec/get_bits.h       (revision 20001)
+++ libavcodec/get_bits.h       (working copy)
@@ -538,7 +538,6 @@
              const void *codes, int codes_wrap, int codes_size,
              const void *symbols, int symbols_wrap, int symbols_size,
              int flags);
-#define INIT_VLC_USE_STATIC 1 ///< VERY strongly deprecated and forbidden
 #define INIT_VLC_LE         2
 #define INIT_VLC_USE_NEW_STATIC 4
 void free_vlc(VLC *vlc);
Index: libavcodec/bitstream.c
===================================================================
--- libavcodec/bitstream.c      (revision 20001)
+++ libavcodec/bitstream.c      (working copy)
@@ -151,7 +151,7 @@
     VLC_TYPE (*table)[2];
 
     table_size = 1 << table_nb_bits;
-    table_index = alloc_table(vlc, table_size, flags & (INIT_VLC_USE_STATIC|INIT_VLC_USE_NEW_STATIC));
+    table_index = alloc_table(vlc, table_size, flags & INIT_VLC_USE_NEW_STATIC);
 #ifdef DEBUG_VLC
     av_log(NULL,AV_LOG_DEBUG,"new table index=%d size=%d code_prefix=%x n=%d\n",
            table_index, table_size, code_prefix, n_prefix);
@@ -286,15 +286,10 @@
         }else if(vlc->table_size){
             abort(); // fatal error, we are called on a partially initialized table
         }
-    }else if(!(flags & INIT_VLC_USE_STATIC)) {
+    }else {
         vlc->table = NULL;
         vlc->table_allocated = 0;
         vlc->table_size = 0;
-    } else {
-        /* Static tables are initially always NULL, return
-           if vlc->table != NULL to avoid double allocation */
-        if(vlc->table)
-            return 0;
     }
 
 #ifdef DEBUG_VLC




More information about the ffmpeg-devel mailing list