MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / pool_release_buffer

Function pool_release_buffer

libavutil/buffer.c:345–357  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

343}
344
345static 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 */

Callers

nothing calls this directly

Calls 3

ff_mutex_lockFunction · 0.85
ff_mutex_unlockFunction · 0.85
buffer_pool_freeFunction · 0.85

Tested by

no test coverage detected