Browse Source

Simplify encoding list generator

Tight is the default preferred encoding, so we don't really need
special handling for it to be first in the list.
tags/v1.9.90
Pierre Ossman 6 years ago
parent
commit
3bbe8d7217
1 changed files with 2 additions and 30 deletions
  1. 2
    30
      common/rfb/CConnection.cxx

+ 2
- 30
common/rfb/CConnection.cxx View File

@@ -595,37 +595,9 @@ void CConnection::updateEncodings()

encodings.push_back(encodingCopyRect);

/*
* Prefer encodings in this order:
*
* Tight, ZRLE, Hextile, *
*/

if ((preferredEncoding != encodingTight) &&
Decoder::supported(encodingTight))
encodings.push_back(encodingTight);

if ((preferredEncoding != encodingZRLE) &&
Decoder::supported(encodingZRLE))
encodings.push_back(encodingZRLE);

if ((preferredEncoding != encodingHextile) &&
Decoder::supported(encodingHextile))
encodings.push_back(encodingHextile);

// Remaining encodings
for (int i = encodingMax; i >= 0; i--) {
switch (i) {
case encodingCopyRect:
case encodingTight:
case encodingZRLE:
case encodingHextile:
/* These have already been sent earlier */
break;
default:
if ((i != preferredEncoding) && Decoder::supported(i))
encodings.push_back(i);
}
if ((i != preferredEncoding) && Decoder::supported(i))
encodings.push_back(i);
}

if (server.compressLevel >= 0 && server.compressLevel <= 9)

Loading…
Cancel
Save