summaryrefslogtreecommitdiffstats
path: root/libvncserver/rfbserver.c
diff options
context:
space:
mode:
authorDRC <information@virtualgl.org>2012-03-10 11:35:51 -0600
committerChristian Beier <dontmind@freeshell.org>2012-03-11 15:36:26 +0100
commit503dd6bb6960ef0e35d647c6a51f013f7b62cb45 (patch)
tree9eb24aa96aa01981060ae5062be447cc7ed5387e /libvncserver/rfbserver.c
parent97001a7e7bc80b45ac7c86413afa69f2a0300e7f (diff)
downloadlibtdevnc-503dd6bb6960ef0e35d647c6a51f013f7b62cb45.tar.gz
libtdevnc-503dd6bb6960ef0e35d647c6a51f013f7b62cb45.zip
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.
Diffstat (limited to 'libvncserver/rfbserver.c')
-rw-r--r--libvncserver/rfbserver.c9
1 files changed, 9 insertions, 0 deletions
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++) {