]> git.sesse.net Git - vlc/blobdiff - src/misc/picture_pool.c
picture_pool: fix prototype, fix warnings
[vlc] / src / misc / picture_pool.c
index 135b5d6d90f3dd7900cfd4fea911fef2397e8a36..e899f9eabbc5e46ea945822500a438a384c83dfc 100644 (file)
@@ -41,11 +41,11 @@ struct picture_gc_sys_t {
     picture_pool_t *pool;
     picture_t *picture;
     bool in_use;
-    int64_t tick;
+    uint64_t tick;
 };
 
 struct picture_pool_t {
-    int64_t        tick;
+    uint64_t       tick;
     /* */
     unsigned       picture_count;
     picture_t      **picture;
@@ -56,7 +56,7 @@ struct picture_pool_t {
     vlc_mutex_t lock;
 };
 
-static void picture_pool_Release(picture_pool_t *pool)
+void picture_pool_Release(picture_pool_t *pool)
 {
     bool destroy;
 
@@ -231,11 +231,6 @@ error:
     return NULL;
 }
 
-void picture_pool_Delete(picture_pool_t *pool)
-{
-    picture_pool_Release(pool);
-}
-
 picture_t *picture_pool_Get(picture_pool_t *pool)
 {
     vlc_mutex_lock(&pool->lock);
@@ -274,8 +269,9 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
     return NULL;
 }
 
-void picture_pool_Reset(picture_pool_t *pool)
+unsigned picture_pool_Reset(picture_pool_t *pool)
 {
+    unsigned ret = 0;
 retry:
     vlc_mutex_lock(&pool->lock);
     assert(pool->refs > 0);
@@ -287,11 +283,13 @@ retry:
         if (sys->in_use) {
             vlc_mutex_unlock(&pool->lock);
             picture_Release(picture);
-
+            ret++;
             goto retry;
         }
     }
     vlc_mutex_unlock(&pool->lock);
+
+    return ret;
 }
 
 void picture_pool_NonEmpty(picture_pool_t *pool)
@@ -328,7 +326,7 @@ void picture_pool_NonEmpty(picture_pool_t *pool)
     vlc_mutex_unlock(&pool->lock);
 }
 
-int picture_pool_GetSize(picture_pool_t *pool)
+unsigned picture_pool_GetSize(const picture_pool_t *pool)
 {
     return pool->picture_count;
 }