static void picture_pool_ReleasePicture(picture_t *clone) { picture_priv_t *priv = (picture_priv_t *)clone; uintptr_t sys = (uintptr_t)priv->gc.opaque; picture_pool_t *pool = (void *)(sys & ~(pool_max - 1)); unsigned offset = sys & (pool_max - 1); picture_t *picture = pool->picture[offset]; free(clone); if (pool->pic_unlock != NULL) pool->pic_unlock(picture); picture_Release(picture); vlc_mutex_lock(&pool->lock); assert(!(pool->available & (1ULL << offset))); pool->available |= 1ULL << offset; vlc_mutex_unlock(&pool->lock); picture_pool_Destroy(pool); }
void picture_pool_Release(picture_pool_t *pool) { for (unsigned i = 0; i < pool->picture_count; i++) picture_Release(pool->picture[i]); picture_pool_Destroy(pool); }