tight: Check quality level at start of each frame

pull/30/head
Andri Yngvason 2020-04-03 22:54:46 +00:00
parent b44d1a1f58
commit a54b9ddd8e
1 changed files with 2 additions and 3 deletions

View File

@ -275,9 +275,6 @@ int tight_encode_box(struct tight_encoder* self, struct vec* dst,
uint32_t x, uint32_t y, uint32_t x, uint32_t y,
uint32_t stride, uint32_t width, uint32_t height) uint32_t stride, uint32_t width, uint32_t height)
{ {
if (self->quality == TIGHT_QUALITY_UNSPEC)
self->quality = tight_get_quality(self);
switch (self->quality) { switch (self->quality) {
case TIGHT_QUALITY_LOSSLESS: case TIGHT_QUALITY_LOSSLESS:
return tight_encode_box_basic(self, dst, fb, src_fmt, x, y, 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, const struct rfb_pixel_format* src_fmt,
struct pixman_region16* region) struct pixman_region16* region)
{ {
self->quality = tight_get_quality(self);
int rc = -1; int rc = -1;
int n_rects = 0; int n_rects = 0;