diff options
author | Cameron Esfahani <dirty@apple.com> | 2020-01-20 21:00:52 -0800 |
---|---|---|
committer | Gerd Hoffmann <kraxel@redhat.com> | 2020-01-21 07:29:03 +0100 |
commit | 557ba0e57200014bd4f453f6516f02b61bdfc782 (patch) | |
tree | de3705821464e65fbef38cb3b6abc9b2ab502508 /ui/vnc-enc-zrle.c | |
parent | 0780ec7be82dd4781e9fd216b5d99a125882ff5a (diff) |
vnc: prioritize ZRLE compression over ZLIB
In my investigation, ZRLE always compresses better than ZLIB so
prioritize ZRLE over ZLIB, even if the client hints that ZLIB is
preferred.
zlib buffer is always reset in zrle_compress_data(), so using offset to
calculate next_out and avail_out is useless.
Signed-off-by: Cameron Esfahani <dirty@apple.com>
Message-Id: <b5d129895d08a90d0a2a6183b95875bacfa998b8.1579582674.git.dirty@apple.com>
Signed-off-by: Gerd Hoffmann <kraxel@redhat.com>
Diffstat (limited to 'ui/vnc-enc-zrle.c')
-rw-r--r-- | ui/vnc-enc-zrle.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ui/vnc-enc-zrle.c b/ui/vnc-enc-zrle.c index 17fd28a2e2..b4f71e32cf 100644 --- a/ui/vnc-enc-zrle.c +++ b/ui/vnc-enc-zrle.c @@ -98,8 +98,8 @@ static int zrle_compress_data(VncState *vs, int level) /* set pointers */ zstream->next_in = vs->zrle->zrle.buffer; zstream->avail_in = vs->zrle->zrle.offset; - zstream->next_out = vs->zrle->zlib.buffer + vs->zrle->zlib.offset; - zstream->avail_out = vs->zrle->zlib.capacity - vs->zrle->zlib.offset; + zstream->next_out = vs->zrle->zlib.buffer; + zstream->avail_out = vs->zrle->zlib.capacity; zstream->data_type = Z_BINARY; /* start encoding */ |