From 503dd6bb6960ef0e35d647c6a51f013f7b62cb45 Mon Sep 17 00:00:00 2001 From: DRC Date: Sat, 10 Mar 2012 11:35:51 -0600 Subject: Fix an issue that affects the existing Tight encoder as well as the newly-implemented Turbo encoder. The issue is that, when using the current libvncserver source, it is impossible to disable Tight JPEG encoding. The way Tight/Turbo viewers disable JPEG encoding is by simply not sending the Tight quality value, causing the server to use the default value of -1. Thus, cl->tightQualityLevel has to be set to -1 prior to processing the encodings message for this mechanism to work. Similarly, it is not guaranteed that the compress level will be set in the encodings message, so it is set to a default value prior to processing the message. --- libvncserver/rfbserver.c | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/libvncserver/rfbserver.c b/libvncserver/rfbserver.c index 04231f2..3f4b896 100644 --- a/libvncserver/rfbserver.c +++ b/libvncserver/rfbserver.c @@ -1967,6 +1967,15 @@ rfbProcessClientNormalMessage(rfbClientPtr cl) cl->enableSupportedMessages = FALSE; cl->enableSupportedEncodings = FALSE; cl->enableServerIdentity = FALSE; +#if defined(LIBVNCSERVER_HAVE_LIBZ) || defined(LIBVNCSERVER_HAVE_LIBPNG) + cl->tightQualityLevel = -1; +#if defined(LIBVNCSERVER_HAVE_LIBJPEG) || defined(LIBVNCSERVER_HAVE_TURBOVNC) || defined(LIBVNCSERVER_HAVE_LIBPNG) + cl->tightCompressLevel = TIGHT_DEFAULT_COMPRESSION; +#endif +#ifdef LIBVNCSERVER_HAVE_TURBOVNC + cl->tightSubsampLevel = TIGHT_DEFAULT_SUBSAMP; +#endif +#endif for (i = 0; i < msg.se.nEncodings; i++) { -- cgit v1.2.3