} else
av_freep(dst);
- if (atomic_fetch_add_explicit(&b->refcount, -1, memory_order_acq_rel) == 1) {
+ if (atomic_fetch_sub_explicit(&b->refcount, 1, memory_order_acq_rel) == 1) {
b->free(b->opaque, b->data);
av_freep(&b);
}
pool = *ppool;
*ppool = NULL;
- if (atomic_fetch_add_explicit(&pool->refcount, -1, memory_order_acq_rel) == 1)
+ if (atomic_fetch_sub_explicit(&pool->refcount, 1, memory_order_acq_rel) == 1)
buffer_pool_free(pool);
}
pool->pool = buf;
ff_mutex_unlock(&pool->mutex);
- if (atomic_fetch_add_explicit(&pool->refcount, -1, memory_order_acq_rel) == 1)
+ if (atomic_fetch_sub_explicit(&pool->refcount, 1, memory_order_acq_rel) == 1)
buffer_pool_free(pool);
}