From a54b9ddd8eaef6b730ea5450c63121d28118fef3 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Fri, 3 Apr 2020 22:54:46 +0000 Subject: [PATCH] tight: Check quality level at start of each frame --- src/tight.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/tight.c b/src/tight.c index 5350fc9..97e04bf 100644 --- a/src/tight.c +++ b/src/tight.c @@ -275,9 +275,6 @@ int tight_encode_box(struct tight_encoder* self, struct vec* dst, uint32_t x, uint32_t y, uint32_t stride, uint32_t width, uint32_t height) { - if (self->quality == TIGHT_QUALITY_UNSPEC) - self->quality = tight_get_quality(self); - switch (self->quality) { case TIGHT_QUALITY_LOSSLESS: return tight_encode_box_basic(self, dst, fb, src_fmt, x, y, @@ -298,6 +295,8 @@ int tight_encode_frame(struct tight_encoder* self, struct vec* dst, const struct rfb_pixel_format* src_fmt, struct pixman_region16* region) { + self->quality = tight_get_quality(self); + int rc = -1; int n_rects = 0;