summaryrefslogtreecommitdiffstats
path: root/vncviewer/CConn.cxx
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2014-03-17 14:42:10 +0100
committerPierre Ossman <ossman@cendio.se>2014-07-07 13:27:09 +0200
commita22459d356be884aca3f4a1974de3e005da8ce7c (patch)
treeaab8e831fd93b7038cfd1b25ed85645578d68d42 /vncviewer/CConn.cxx
parent6bcf137779ee884f27d53d667558524d3413812e (diff)
downloadtigervnc-a22459d356be884aca3f4a1974de3e005da8ce7c.tar.gz
tigervnc-a22459d356be884aca3f4a1974de3e005da8ce7c.zip
Remove magic JPEG variables from ConnParams
Custom compression level and JPEG on/off are not inherent parts of the protocol negotiation so they do not belong in ConnParams. Let the UI frontend handle such things instead.
Diffstat (limited to 'vncviewer/CConn.cxx')
-rw-r--r--vncviewer/CConn.cxx25
1 files changed, 16 insertions, 9 deletions
diff --git a/vncviewer/CConn.cxx b/vncviewer/CConn.cxx
index c5cd4a45..789cf09e 100644
--- a/vncviewer/CConn.cxx
+++ b/vncviewer/CConn.cxx
@@ -89,11 +89,15 @@ CConn::CConn(const char* vncServerName, network::Socket* socket=NULL)
cp.supportsExtendedDesktopSize = true;
cp.supportsDesktopRename = true;
- cp.customCompressLevel = customCompressLevel;
- cp.compressLevel = compressLevel;
+ if (customCompressLevel)
+ cp.compressLevel = compressLevel;
+ else
+ cp.compressLevel = -1;
- cp.noJpeg = noJpeg;
- cp.qualityLevel = qualityLevel;
+ if (!noJpeg)
+ cp.qualityLevel = qualityLevel;
+ else
+ cp.qualityLevel = -1;
if(sock == NULL) {
try {
@@ -619,16 +623,19 @@ void CConn::handleOptions(void *data)
if (encNum != -1)
self->currentEncoding = encNum;
-
- self->cp.qualityLevel = qualityLevel;
}
self->cp.supportsLocalCursor = true;
- self->cp.customCompressLevel = customCompressLevel;
- self->cp.compressLevel = compressLevel;
+ if (customCompressLevel)
+ self->cp.compressLevel = compressLevel;
+ else
+ self->cp.compressLevel = -1;
- self->cp.noJpeg = noJpeg;
+ if (!noJpeg && !autoSelect)
+ self->cp.qualityLevel = qualityLevel;
+ else
+ self->cp.qualityLevel = -1;
self->encodingChange = true;