History

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

James Almer committed 6 years ago

Commit ec39c221 parent 7f817853 files · +7 −1Browse files

Unified · Split

3 files
  1. doc/APIchanges +3 −0
  2. libavutil/buffer.c +3 −0
  3. libavutil/version.h +1 −1
doc/APIchanges+3−0
@@ -15,6 +15,9 @@ libavutil: 2017-10-21 · 14 unmodified lines
15 15
16API changes, most recent first:16API changes, most recent first:
17 17
182020-06-xx - xxxxxxxxxx - lavu 56.50.100 - buffer.h
19 Passing NULL as alloc argument to av_buffer_pool_init2() is now allowed.
20
182020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h212020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h
19 Move AVCodec-related public API to new header codec.h.22 Move AVCodec-related public API to new header codec.h.
20 23
libavutil/buffer.c+3−0
@@ -229,6 +229,7 @@ AVBufferPool *av_buffer_pool_init2(int size, void *opaque, · 228 unmodified lines
229 pool->size = size;229 pool->size = size;
230 pool->opaque = opaque;230 pool->opaque = opaque;
231 pool->alloc2 = alloc;231 pool->alloc2 = alloc;
232 pool->alloc = av_buffer_alloc; // fallback
232 pool->pool_free = pool_free;233 pool->pool_free = pool_free;
233 234
234 atomic_init(&pool->refcount, 1);235 atomic_init(&pool->refcount, 1);
@@ -310,6 +311,8 @@ static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool) · 75 unmodified lines
310 BufferPoolEntry *buf;311 BufferPoolEntry *buf;
311 AVBufferRef *ret;312 AVBufferRef *ret;
312 313
314 av_assert0(pool->alloc || pool->alloc2);
315
313 ret = pool->alloc2 ? pool->alloc2(pool->opaque, pool->size) :316 ret = pool->alloc2 ? pool->alloc2(pool->opaque, pool->size) :
314 pool->alloc(pool->size);317 pool->alloc(pool->size);
315 if (!ret)318 if (!ret)
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
79 */79 */
80 80
81#define LIBAVUTIL_VERSION_MAJOR 5681#define LIBAVUTIL_VERSION_MAJOR 56
82#define LIBAVUTIL_VERSION_MINOR 4982#define LIBAVUTIL_VERSION_MINOR 50
83#define LIBAVUTIL_VERSION_MICRO 10083#define LIBAVUTIL_VERSION_MICRO 100
84 84
85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \85#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t