Browse Source

avutil/buffer: use the default allocator if none is provided to av_buffer_pool_init2()

Signed-off-by: James Almer <jamrial@gmail.com>
tags/n4.3
James Almer 5 years ago
parent
commit
ec39c2276a
3 changed files with 7 additions and 1 deletions
  1. +3
    -0
      doc/APIchanges
  2. +3
    -0
      libavutil/buffer.c
  3. +1
    -1
      libavutil/version.h

+ 3
- 0
doc/APIchanges View 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.



+ 3
- 0
libavutil/buffer.c View 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)


+ 1
- 1
libavutil/version.h View 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, \


Loading…
Cancel
Save