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
1515
1616 API changes, most recent first:
1717
18+2020-06-xx - xxxxxxxxxx - lavu 56.50.100 - buffer.h
19+ Passing NULL as alloc argument to av_buffer_pool_init2() is now allowed.
20+
1821 2020-xx-xx - xxxxxxxxxx - lavc 58.88.100 - avcodec.h codec.h
1922 Move AVCodec-related public API to new header codec.h.
2023
libavutil/buffer.c+3−0
@@ -229,6 +229,7 @@ AVBufferPool *av_buffer_pool_init2(int size, void *opaque, · 228 unmodified lines
229229 pool->size = size;
230230 pool->opaque = opaque;
231231 pool->alloc2 = alloc;
232+ pool->alloc = av_buffer_alloc; // fallback
232233 pool->pool_free = pool_free;
233234
234235 atomic_init(&pool->refcount, 1);
@@ -310,6 +311,8 @@ static AVBufferRef *pool_alloc_buffer(AVBufferPool *pool) · 75 unmodified lines
310311 BufferPoolEntry *buf;
311312 AVBufferRef *ret;
312313
314+ av_assert0(pool->alloc || pool->alloc2);
315+
313316 ret = pool->alloc2 ? pool->alloc2(pool->opaque, pool->size) :
314317 pool->alloc(pool->size);
315318 if (!ret)
libavutil/version.h+1−1
@@ -79,7 +79,7 @@ · 78 unmodified lines
7979 */
8080
8181 #define LIBAVUTIL_VERSION_MAJOR 56
82−#define LIBAVUTIL_VERSION_MINOR 49
82+#define LIBAVUTIL_VERSION_MINOR 50
8383 #define LIBAVUTIL_VERSION_MICRO 100
8484
8585 #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