Skip to content

Commit

Permalink
picture_pool: remove no longer used ticks
Browse files Browse the repository at this point in the history
  • Loading branch information
Rémi Denis-Courmont committed Jun 26, 2015
1 parent a102fb4 commit 7958946
Showing 1 changed file with 0 additions and 8 deletions.
8 changes: 0 additions & 8 deletions src/misc/picture_pool.c
Original file line number Diff line number Diff line change
Expand Up @@ -42,11 +42,9 @@ struct picture_gc_sys_t {
picture_pool_t *pool;
picture_t *picture;
bool in_use;
uint64_t tick;
};

struct picture_pool_t {
uint64_t tick;
int (*pic_lock)(picture_t *);
void (*pic_unlock)(picture_t *);
vlc_mutex_t lock;
Expand Down Expand Up @@ -108,7 +106,6 @@ static picture_t *picture_pool_ClonePicture(picture_pool_t *pool,
sys->pool = pool;
sys->picture = picture;
sys->in_use = false;
sys->tick = 0;

picture_resource_t res = {
.p_sys = picture->p_sys,
Expand Down Expand Up @@ -137,7 +134,6 @@ picture_pool_t *picture_pool_NewExtended(const picture_pool_configuration_t *cfg
if (unlikely(pool == NULL))
return NULL;

pool->tick = 1;
pool->pic_lock = cfg->lock;
pool->pic_unlock = cfg->unlock;
vlc_mutex_init(&pool->lock);
Expand Down Expand Up @@ -223,13 +219,11 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
picture_t *picture = pool->picture[i];
picture_priv_t *priv = (picture_priv_t *)picture;
picture_gc_sys_t *sys = priv->gc.opaque;
uint64_t tick;

if (sys->in_use)
continue;

pool->refs++;
tick = ++pool->tick;
sys->in_use = true;
vlc_mutex_unlock(&pool->lock);

Expand All @@ -240,8 +234,6 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
continue;
}

sys->tick = tick;

assert(atomic_load(&((picture_priv_t *)picture)->gc.refs) == 0);
atomic_init(&((picture_priv_t *)picture)->gc.refs, 1);
picture->p_next = NULL;
Expand Down

0 comments on commit 7958946

Please sign in to comment.