Revert "vnc: set the right prefered encoding"

This patch was wrong, because the loop was already reversed,
so the first encoding was correctly set at the end of the loopp.

This reverts commit 14eb8b6829.

Signed-off-by: Corentin Chary <corentincj@iksaif.net>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
This commit is contained in:
Corentin Chary 2010-05-19 09:24:01 +02:00 committed by Anthony Liguori
parent 9af9b330c5
commit a9f20d31a8
1 changed files with 4 additions and 10 deletions

14
vnc.c
View File

@ -1644,7 +1644,7 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
vnc_zlib_init(vs);
vs->features = 0;
vs->vnc_encoding = -1;
vs->vnc_encoding = 0;
vs->tight_compression = 9;
vs->tight_quality = 9;
vs->absolute = -1;
@ -1653,24 +1653,18 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings)
enc = encodings[i];
switch (enc) {
case VNC_ENCODING_RAW:
if (vs->vnc_encoding != -1) {
vs->vnc_encoding = enc;
}
vs->vnc_encoding = enc;
break;
case VNC_ENCODING_COPYRECT:
vs->features |= VNC_FEATURE_COPYRECT_MASK;
break;
case VNC_ENCODING_HEXTILE:
vs->features |= VNC_FEATURE_HEXTILE_MASK;
if (vs->vnc_encoding != -1) {
vs->vnc_encoding = enc;
}
vs->vnc_encoding = enc;
break;
case VNC_ENCODING_ZLIB:
vs->features |= VNC_FEATURE_ZLIB_MASK;
if (vs->vnc_encoding != -1) {
vs->vnc_encoding = enc;
}
vs->vnc_encoding = enc;
break;
case VNC_ENCODING_DESKTOPRESIZE:
vs->features |= VNC_FEATURE_RESIZE_MASK;