tight2: Release zstream earlier

tight-encoder-v2
Andri Yngvason 2020-07-09 10:28:52 +00:00
parent a2f5f11d14
commit ed054fe00d
1 changed files with 5 additions and 2 deletions

View File

@ -296,14 +296,17 @@ static void tight_encode_tile(struct tight_encoder_v2* self,
}; };
pthread_mutex_lock(&self->dst_mutex); 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, &rect, sizeof(rect));
vec_append(self->dst, &tile->type, sizeof(tile->type)); vec_append(self->dst, &tile->type, sizeof(tile->type));
tight_encode_size(self->dst, tile->size); tight_encode_size(self->dst, tile->size);
vec_append(self->dst, tile->buffer, tile->size); vec_append(self->dst, tile->buffer, tile->size);
pthread_mutex_unlock(&self->dst_mutex); 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; tile->state = TIGHT_TILE_READY;
} }