[FFmpeg-devel] [PATCH] remove INIT_VLC_USE_STATIC

Reimar Döffinger Reimar.Doeffinger
Thu Sep 24 17:27:39 CEST 2009


On Thu, Sep 24, 2009 at 12:45:20PM +0200, Michael Niedermayer wrote:
> On Thu, Sep 24, 2009 at 12:03:55PM +0200, Reimar D?ffinger wrote:
> > 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.
> 
> ok

Applied, but I missed two more parts.
I think that ff_realloc_static can be removed without a major version
bump, since AFAICT it was neither public nor used by libavformat, so
there should be no issue removing it, right?
So I suggest this (do you want it applied as two parts?):
Index: libavcodec/bitstream.c
===================================================================
--- libavcodec/bitstream.c      (revision 20013)
+++ libavcodec/bitstream.c      (working copy)
@@ -38,25 +38,6 @@
  8, 9,10,11,12,13,14,15
 };
 
-#if LIBAVCODEC_VERSION_MAJOR < 53
-/**
- * Same as av_mallocz_static(), but does a realloc.
- *
- * @param[in] ptr The block of memory to reallocate.
- * @param[in] size The requested size.
- * @return Block of memory of requested size.
- * @deprecated. Code which uses ff_realloc_static is broken/misdesigned
- * and should correctly use static arrays
- */
-attribute_deprecated av_alloc_size(2)
-static void *ff_realloc_static(void *ptr, unsigned int size);
-
-static void *ff_realloc_static(void *ptr, unsigned int size)
-{
-    return av_realloc(ptr, size);
-}
-#endif
-
 void align_put_bits(PutBitContext *s)
 {
 #ifdef ALT_BITSTREAM_WRITER
@@ -124,13 +105,9 @@
     index = vlc->table_size;
     vlc->table_size += size;
     if (vlc->table_size > vlc->table_allocated) {
-        if(use_static>1)
+        if(use_static)
             abort(); //cant do anything, init_vlc() is used with too little memory
         vlc->table_allocated += (1 << vlc->bits);
-        if(use_static)
-            vlc->table = ff_realloc_static(vlc->table,
-                                           sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
-        else
             vlc->table = av_realloc(vlc->table,
                                     sizeof(VLC_TYPE) * 2 * vlc->table_allocated);
         if (!vlc->table)



More information about the ffmpeg-devel mailing list