Commit d006762c authored by Rémi Denis-Courmont's avatar Rémi Denis-Courmont

picture_pool: remove evil no longer used picture_pool_NonEmpty()

parent e56293ea
...@@ -145,17 +145,6 @@ VLC_API void picture_pool_Enum( picture_pool_t *, ...@@ -145,17 +145,6 @@ VLC_API void picture_pool_Enum( picture_pool_t *,
*/ */
unsigned picture_pool_Reset( picture_pool_t * ); unsigned picture_pool_Reset( picture_pool_t * );
/**
* Forcefully marks one picture free if all pictures in the pool are allocated.
*
* @warning This is intrinsically race-prone. If the freed picture is still
* used, video will be corrupt, and the process will likely crash.
*
* @bug Do not use this function. It will never work properly.
* Fix the decoder bugs instead.
*/
void picture_pool_NonEmpty( picture_pool_t * );
/** /**
* Reserves pictures from a pool and creates a new pool with those. * Reserves pictures from a pool and creates a new pool with those.
* *
......
...@@ -289,40 +289,6 @@ retry: ...@@ -289,40 +289,6 @@ retry:
return ret; return ret;
} }
void picture_pool_NonEmpty(picture_pool_t *pool)
{
picture_t *oldest = NULL;
uint64_t tick = 0;
vlc_mutex_lock(&pool->lock);
assert(pool->refs > 0);
for (unsigned i = 0; i < pool->picture_count; i++) {
picture_t *picture = pool->picture[i];
picture_gc_sys_t *sys = picture->gc.p_sys;
if (!sys->in_use) {
vlc_mutex_unlock(&pool->lock);
return; /* Nothing to do */
}
if (picture->gc.p_sys->tick < tick) {
oldest = picture;
tick = picture->gc.p_sys->tick;
}
}
if (oldest != NULL) {
while (oldest->gc.p_sys->in_use) {
vlc_mutex_unlock(&pool->lock);
picture_Release(oldest);
vlc_mutex_lock(&pool->lock);
}
}
vlc_mutex_unlock(&pool->lock);
}
unsigned picture_pool_GetSize(const picture_pool_t *pool) unsigned picture_pool_GetSize(const picture_pool_t *pool)
{ {
return pool->picture_count; return pool->picture_count;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment