From 000324eff73f71d85969e68435dcfb04d2720c3d Mon Sep 17 00:00:00 2001 From: Constantin Kaplinsky Date: Fri, 7 Dec 2007 10:38:51 +0000 Subject: [PATCH] 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 --- common/rfb/SMsgWriter.cxx | 5 +++-- 1 file 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) -- 2.39.5