| 343 | } |
| 344 | |
| 345 | static void pool_release_buffer(void *opaque, uint8_t *data) |
| 346 | { |
| 347 | BufferPoolEntry *buf = opaque; |
| 348 | AVBufferPool *pool = buf->pool; |
| 349 | |
| 350 | ff_mutex_lock(&pool->mutex); |
| 351 | buf->next = pool->pool; |
| 352 | pool->pool = buf; |
| 353 | ff_mutex_unlock(&pool->mutex); |
| 354 | |
| 355 | if (atomic_fetch_sub_explicit(&pool->refcount, 1, memory_order_acq_rel) == 1) |
| 356 | buffer_pool_free(pool); |
| 357 | } |
| 358 | |
| 359 | /* allocate a new buffer and override its free() callback so that |
| 360 | * it is returned to the pool on free */ |
nothing calls this directly
no test coverage detected