[vlc-commits] picture_pool: remove evil no longer used picture_pool_NonEmpty()

Rémi Denis-Courmont git at videolan.org
Fri Apr 24 22:47:03 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Wed Oct 29 16:54:27 2014 +0200| [d006762c7017aa9c48457a197f67f6609821502a] | committer: Rémi Denis-Courmont

picture_pool: remove evil no longer used picture_pool_NonEmpty()

> http://git.videolan.org/gitweb.cgi/vlc.git/?a=commit;h=d006762c7017aa9c48457a197f67f6609821502a
---

 include/vlc_picture_pool.h |   11 -----------
 src/misc/picture_pool.c    |   34 ----------------------------------
 2 files changed, 45 deletions(-)

diff --git a/include/vlc_picture_pool.h b/include/vlc_picture_pool.h
index a0cf9f3..37ef7b3 100644
--- a/include/vlc_picture_pool.h
+++ b/include/vlc_picture_pool.h
@@ -146,17 +146,6 @@ VLC_API void picture_pool_Enum( 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.
  *
  * When the new pool is released, pictures are returned to the master pool.
diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
index 98e093f..64c60a9 100644
--- a/src/misc/picture_pool.c
+++ b/src/misc/picture_pool.c
@@ -289,40 +289,6 @@ retry:
     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)
 {
     return pool->picture_count;



More information about the vlc-commits mailing list