[PATCH 2/2] Rename image_encoders_free_glz_drawable()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Rename this function to red_glz_drawable_free() and remove the
ImageEncoders argument since the RedGlzDrawable already holds a pointer
to the ImageEncoders structure
---
 server/dcc-encoders.c | 17 +++++++++--------
 1 file changed, 9 insertions(+), 8 deletions(-)

diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index 32908d0..4049eec 100644
--- a/server/dcc-encoders.c
+++ b/server/dcc-encoders.c
@@ -534,14 +534,15 @@ static void glz_drawable_instance_item_free(GlzDrawableInstanceItem *instance)
  * if possible.
  * NOTE - the caller should prevent encoding using the dictionary during this operation
  */
-static void image_encoders_free_glz_drawable(ImageEncoders *enc, RedGlzDrawable *drawable)
+static void red_glz_drawable_free(RedGlzDrawable *glz_drawable)
 {
-    RingItem *head_instance = ring_get_head(&drawable->instances);
+    ImageEncoders *enc = glz_drawable->encoders;
+    RingItem *head_instance = ring_get_head(&glz_drawable->instances);
     int cont = (head_instance != NULL);
 
     while (cont) {
-        if (drawable->instances_count == 1) {
-            /* Last instance: image_encoders_free_glz_drawable_instance will free the drawable */
+        if (glz_drawable->instances_count == 1) {
+            /* Last instance: glz_drawable_instance_item_free will free the glz_drawable */
             cont = FALSE;
         }
         GlzDrawableInstanceItem *instance = SPICE_CONTAINEROF(head_instance,
@@ -556,7 +557,7 @@ static void image_encoders_free_glz_drawable(ImageEncoders *enc, RedGlzDrawable
         glz_drawable_instance_item_free(instance);
 
         if (cont) {
-            head_instance = ring_get_head(&drawable->instances);
+            head_instance = ring_get_head(&glz_drawable->instances);
         }
     }
 }
@@ -593,7 +594,7 @@ int image_encoders_free_some_independent_glz_drawables(ImageEncoders *enc)
         RedGlzDrawable *glz_drawable = SPICE_CONTAINEROF(ring_link, RedGlzDrawable, link);
         ring_link = ring_next(&enc->glz_drawables, ring_link);
         if (!glz_drawable->has_drawable) {
-            image_encoders_free_glz_drawable(enc, glz_drawable);
+            red_glz_drawable_free(glz_drawable);
             n++;
         }
     }
@@ -634,7 +635,7 @@ void image_encoders_free_glz_drawables(ImageEncoders *enc)
         RedGlzDrawable *drawable = SPICE_CONTAINEROF(ring_link, RedGlzDrawable, link);
         // no need to lock the to_free list, since we assured no other thread is encoding and
         // thus not other thread access the to_free list of the channel
-        image_encoders_free_glz_drawable(enc, drawable);
+        red_glz_drawable_free(drawable);
     }
     pthread_rwlock_unlock(&glz_dict->encode_lock);
 }
@@ -644,7 +645,7 @@ void image_encoders_glz_free_from_drawable_ring(Ring *drawable_ring)
     RingItem *glz_item, *next_item;
     RedGlzDrawable *glz;
     SAFE_FOREACH(glz_item, next_item, TRUE, drawable_ring, glz, LINK_TO_GLZ(glz_item)) {
-        image_encoders_free_glz_drawable(glz->encoders, glz);
+        red_glz_drawable_free(glz);
     }
 }
 
-- 
2.5.5

_______________________________________________
Spice-devel mailing list
Spice-devel@xxxxxxxxxxxxxxxxxxxxx
https://lists.freedesktop.org/mailman/listinfo/spice-devel




[Index of Archives]     [Linux ARM Kernel]     [Linux ARM]     [Linux Omap]     [Fedora ARM]     [IETF Annouce]     [Security]     [Bugtraq]     [Linux]     [Linux OMAP]     [Linux MIPS]     [ECOS]     [Asterisk Internet PBX]     [Linux API]     [Monitors]