[vlc-commits] picture_pool: remove picture_gc_sys_t.picture

Rémi Denis-Courmont git at videolan.org
Sun Jun 28 14:26:13 CEST 2015


vlc | branch: master | Rémi Denis-Courmont <remi at remlab.net> | Sat Jun 27 16:38:43 2015 +0300| [6f9b58faf72fad7091e5b3340d84facdf7d90270] | committer: Rémi Denis-Courmont

picture_pool: remove picture_gc_sys_t.picture

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

 src/misc/picture_pool.c |    8 +++-----
 1 file changed, 3 insertions(+), 5 deletions(-)

diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
index 77d613f..67d7c27 100644
--- a/src/misc/picture_pool.c
+++ b/src/misc/picture_pool.c
@@ -42,7 +42,6 @@
  *****************************************************************************/
 struct picture_gc_sys_t {
     picture_pool_t *pool;
-    picture_t *picture;
     unsigned offset;
 };
 
@@ -83,7 +82,7 @@ static void picture_pool_ReleasePicture(picture_t *picture)
     picture_pool_t *pool = sys->pool;
 
     if (pool->pic_unlock != NULL)
-        pool->pic_unlock(sys->picture);
+        pool->pic_unlock(pool->picture[sys->offset]);
 
     vlc_mutex_lock(&pool->lock);
     assert(!(pool->available & (1ULL << sys->offset)));
@@ -97,15 +96,14 @@ static void picture_pool_ReleasePicture(picture_t *picture)
 }
 
 static picture_t *picture_pool_ClonePicture(picture_pool_t *pool,
-                                            picture_t *picture,
                                             unsigned offset)
 {
+    picture_t *picture = pool->picture[offset];
     picture_gc_sys_t *sys = malloc(sizeof(*sys));
     if (unlikely(sys == NULL))
         return NULL;
 
     sys->pool = pool;
-    sys->picture = picture;
     sys->offset = offset;
 
     picture_resource_t res = {
@@ -229,7 +227,7 @@ picture_t *picture_pool_Get(picture_pool_t *pool)
             continue;
         }
 
-        picture_t *clone = picture_pool_ClonePicture(pool, picture, i);
+        picture_t *clone = picture_pool_ClonePicture(pool, i);
         assert(unlikely(clone == NULL) || clone->p_next == NULL);
         return clone;
     }



More information about the vlc-commits mailing list