| 281 | } |
| 282 | |
| 283 | AVBufferPool *av_buffer_pool_init(size_t size, AVBufferRef* (*alloc)(size_t size)) |
| 284 | { |
| 285 | AVBufferPool *pool = av_mallocz(sizeof(*pool)); |
| 286 | if (!pool) |
| 287 | return NULL; |
| 288 | |
| 289 | if (ff_mutex_init(&pool->mutex, NULL)) { |
| 290 | av_free(pool); |
| 291 | return NULL; |
| 292 | } |
| 293 | |
| 294 | pool->size = size; |
| 295 | pool->alloc = alloc ? alloc : av_buffer_alloc; |
| 296 | |
| 297 | atomic_init(&pool->refcount, 1); |
| 298 | |
| 299 | return pool; |
| 300 | } |
| 301 | |
| 302 | static void buffer_pool_flush(AVBufferPool *pool) |
| 303 | { |
no test coverage detected