[Spice-commits] server/dcc-encoders.c server/dcc-encoders.h server/display-channel.c
Frediano Ziglio
fziglio at kemper.freedesktop.org
Wed Jun 15 08:33:01 UTC 2016
server/dcc-encoders.c | 15 ++++++++-------
server/dcc-encoders.h | 2 +-
server/display-channel.c | 2 +-
3 files changed, 10 insertions(+), 9 deletions(-)
New commits:
commit 6bfeb5501c66a4a12b019b1c1bd1b52f305ded32
Author: Jonathon Jongsma <jjongsma at redhat.com>
Date: Tue Jun 14 10:14:19 2016 -0500
Rename image_encoders_free_glz_drawable()
Rename this function to red_glz_drawable_free() and remove the
ImageEncoders argument since the RedGlzDrawable already holds a pointer
to the ImageEncoders structure
Acked-by: Frediano Ziglio <fziglio at redhat.com>
diff --git a/server/dcc-encoders.c b/server/dcc-encoders.c
index b634ec4..8c3acd0 100644
--- a/server/dcc-encoders.c
+++ b/server/dcc-encoders.c
@@ -484,14 +484,15 @@ static void glz_drawable_instance_item_free(GlzDrawableInstanceItem *instance)
* if possible.
* NOTE - the caller should prevent encoding using the dictionary during this operation
*/
-void image_encoders_free_glz_drawable(ImageEncoders *enc, RedGlzDrawable *drawable)
+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,
@@ -506,7 +507,7 @@ void image_encoders_free_glz_drawable(ImageEncoders *enc, RedGlzDrawable *drawab
glz_drawable_instance_item_free(instance);
if (cont) {
- head_instance = ring_get_head(&drawable->instances);
+ head_instance = ring_get_head(&glz_drawable->instances);
}
}
}
@@ -529,7 +530,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++;
}
}
@@ -570,7 +571,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);
}
diff --git a/server/dcc-encoders.h b/server/dcc-encoders.h
index abc2ccc..815356a 100644
--- a/server/dcc-encoders.h
+++ b/server/dcc-encoders.h
@@ -43,7 +43,7 @@ void image_encoder_shared_stat_print(const ImageEncoderSharedData *shared_data);
void image_encoders_init(ImageEncoders *enc, ImageEncoderSharedData *shared_data);
void image_encoders_free(ImageEncoders *enc);
-void image_encoders_free_glz_drawable(ImageEncoders *enc, RedGlzDrawable *drawable);
+void red_glz_drawable_free(RedGlzDrawable *drawable);
int image_encoders_free_some_independent_glz_drawables(ImageEncoders *enc);
void image_encoders_free_glz_drawables(ImageEncoders *enc);
void image_encoders_free_glz_drawables_to_free(ImageEncoders* enc);
diff --git a/server/display-channel.c b/server/display-channel.c
index 1dc0d29..1bc9d57 100644
--- a/server/display-channel.c
+++ b/server/display-channel.c
@@ -1182,7 +1182,7 @@ static bool free_one_drawable(DisplayChannel *display, int force_glz_free)
RingItem *glz_item, *next_item;
RedGlzDrawable *glz;
DRAWABLE_FOREACH_GLZ_SAFE(drawable, glz_item, next_item, glz) {
- image_encoders_free_glz_drawable(glz->encoders, glz);
+ red_glz_drawable_free(glz);
}
}
drawable_draw(display, drawable);
More information about the Spice-commits
mailing list