From ed054fe00d774cfa35da527ab8adc5ad609fbcc0 Mon Sep 17 00:00:00 2001 From: Andri Yngvason Date: Thu, 9 Jul 2020 10:28:52 +0000 Subject: [PATCH] tight2: Release zstream earlier --- src/tight-encoder-v2.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/tight-encoder-v2.c b/src/tight-encoder-v2.c index 64746d4..eb1a460 100644 --- a/src/tight-encoder-v2.c +++ b/src/tight-encoder-v2.c @@ -296,14 +296,17 @@ static void tight_encode_tile(struct tight_encoder_v2* self, }; pthread_mutex_lock(&self->dst_mutex); + + // TODO: Check if the tile is basic before releasing stream + tight_release_zstream(self, (tile->type >> 4) & 3); + vec_append(self->dst, &rect, sizeof(rect)); vec_append(self->dst, &tile->type, sizeof(tile->type)); tight_encode_size(self->dst, tile->size); vec_append(self->dst, tile->buffer, tile->size); + pthread_mutex_unlock(&self->dst_mutex); - // TODO: Check if the tile is basic before releasing stream - tight_release_zstream(self, (tile->type >> 4) & 3); tile->state = TIGHT_TILE_READY; }