[vlc-commits] picture_pool: remove picture_gc_sys_t.picture

Rémi Denis-Courmont git at videolan.org
Sun Jun 28 10:57:47 CEST 2015


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

picture_pool: remove picture_gc_sys_t.picture

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

 src/misc/picture_pool.c |   12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/misc/picture_pool.c b/src/misc/picture_pool.c
index ba49d67..17b4b41 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;
         }
 
-        clone = picture_pool_ClonePicture(pool, picture, i);
+        clone = picture_pool_ClonePicture(pool, i);
         assert(unlikely(clone == NULL) || clone->p_next == NULL);
         return clone;
     }
@@ -267,7 +265,9 @@ unsigned picture_pool_GetSize(const picture_pool_t *pool)
 
 picture_t *picture_pool_Deref(picture_t *picture)
 {
-    return ((picture_priv_t *)picture)->gc.opaque->picture;
+    picture_priv_t *priv = (picture_priv_t *)picture;
+
+    return priv->gc.opaque->pool->picture[priv->gc.opaque->offset];
 }
 
 void picture_pool_Enum(picture_pool_t *pool, void (*cb)(void *, picture_t *),



More information about the vlc-commits mailing list