aboutsummaryrefslogtreecommitdiffstats
path: root/common
diff options
context:
space:
mode:
authorConstantin Kaplinsky <const@tightvnc.com>2007-12-07 10:38:51 +0000
committerConstantin Kaplinsky <const@tightvnc.com>2007-12-07 10:38:51 +0000
commit000324eff73f71d85969e68435dcfb04d2720c3d (patch)
tree6c2673bf69ab13d88c3949a72c1a3d1646fa15e0 /common
parentabcbd007cab8f36ea93ac45ade7d02c98f35781e (diff)
downloadtigervnc-000324eff73f71d85969e68435dcfb04d2720c3d.tar.gz
tigervnc-000324eff73f71d85969e68435dcfb04d2720c3d.zip
Do not use JPEG if not requested by the client.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@2374 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'common')
-rw-r--r--common/rfb/SMsgWriter.cxx5
1 files changed, 3 insertions, 2 deletions
diff --git a/common/rfb/SMsgWriter.cxx b/common/rfb/SMsgWriter.cxx
index 1a02ce34..a8b9c29e 100644
--- a/common/rfb/SMsgWriter.cxx
+++ b/common/rfb/SMsgWriter.cxx
@@ -105,7 +105,8 @@ void SMsgWriter::setupCurrentEncoder()
encoders[encoding]->setCompressLevel(cp->compressLevel);
encoders[encoding]->setQualityLevel(cp->qualityLevel);
- jpegEncoder->setQualityLevel(cp->qualityLevel);
+ if (cp->qualityLevel != -1)
+ jpegEncoder->setQualityLevel(cp->qualityLevel);
}
int SMsgWriter::getNumRects(const Rect &r)
@@ -175,7 +176,7 @@ bool SMsgWriter::writeRect(const Rect& r, unsigned int encoding,
bool SMsgWriter::canUseJpegEncoder(PixelBuffer *pb) const
{
- return jpegEncoder->isPixelFormatSupported(pb);
+ return (cp->qualityLevel != -1 && jpegEncoder->isPixelFormatSupported(pb));
}
void SMsgWriter::writeJpegRect(PixelBuffer *pb, const Rect& r)