]> git.sesse.net Git - ffmpeg/commitdiff
avutil/buffer: use the default allocator if none is provided to av_buffer_pool_init2()
authorJames Almer <jamrial@gmail.com>
Mon, 1 Jun 2020 13:25:09 +0000 (10:25 -0300)
committerJames Almer <jamrial@gmail.com>
Fri, 5 Jun 2020 13:07:04 +0000 (10:07 -0300)
Signed-off-by: James Almer <jamrial@gmail.com>
doc/APIchanges
libavutil/buffer.c
libavutil/version.h

index fb5534b5f54c615a54a75db951410a381104fff0..c7e4ce3e6ac35b29c235e04ad1a770fa05aaa382 100644 (file)
@@ -15,6 +15,9 @@ libavutil:     2017-10-21
 
 API changes, most recent first:
 
+2020-06-xx - xxxxxxxxxx - lavu 56.50.100 - buffer.h
+  Passing NULL as alloc argument to av_buffer_pool_init2() is now allowed.
+
 2020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h
   Move AVCodec-related public API to new header codec.h.
 
index 6d9cb7428e35cf8bf441a485b16278618a6d61ec..b43cd179d7d09c43ce15087580850e297a384b25 100644 (file)
@@ -229,6 +229,7 @@ AVBufferPool *av_buffer_pool_init2(int size, void *opaque,
     pool->size      = size;
     pool->opaque    = opaque;
     pool->alloc2    = alloc;
+    pool->alloc     = av_buffer_alloc; // fallback
     pool->pool_free = pool_free;
 
     atomic_init(&pool->refcount, 1);
@@ -310,6 +311,8 @@ static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool)
     BufferPoolEntry *buf;
     AVBufferRef     *ret;
 
+    av_assert0(pool->alloc || pool->alloc2);
+
     ret = pool->alloc2 ? pool->alloc2(pool->opaque, pool->size) :
                          pool->alloc(pool->size);
     if (!ret)
index 7acecf5a97507cf30cff5f08e1afd954df5350b6..5d5cec62abc3e7db48a49500c20fa10f57add616 100644 (file)
@@ -79,7 +79,7 @@
  */
 
 #define LIBAVUTIL_VERSION_MAJOR  56
-#define LIBAVUTIL_VERSION_MINOR  49
+#define LIBAVUTIL_VERSION_MINOR  50
 #define LIBAVUTIL_VERSION_MICRO 100
 
 #define LIBAVUTIL_VERSION_INT   AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \