[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH v3 02/12] vnc: explain why set_encodings loop is rev
From: |
Corentin Chary |
Subject: |
[Qemu-devel] [PATCH v3 02/12] vnc: explain why set_encodings loop is reversed |
Date: |
Wed, 19 May 2010 09:24:02 +0200 |
Add a small comment to explain why we need to start from
the end of the array to set the right prefered encoding.
Signed-off-by: Corentin Chary <address@hidden>
---
vnc.c | 5 +++++
1 files changed, 5 insertions(+), 0 deletions(-)
diff --git a/vnc.c b/vnc.c
index b1a3fdb..d0402b9 100644
--- a/vnc.c
+++ b/vnc.c
@@ -1599,6 +1599,11 @@ static void set_encodings(VncState *vs, int32_t
*encodings, size_t n_encodings)
vs->tight_quality = 9;
vs->absolute = -1;
+ /*
+ * Start from the end because the encodings are sent in order of
preference.
+ * This way the prefered encoding (first encoding defined in the array)
+ * will be set at the end of the loop.
+ */
for (i = n_encodings - 1; i >= 0; i--) {
enc = encodings[i];
switch (enc) {
--
1.7.0.2
- [Qemu-devel] [PATCH v3 00/12] *** SUBJECT HERE ***, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 01/12] Revert "vnc: set the right prefered encoding", Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 04/12] vnc: only use a single zlib stream, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 03/12] vnc: really call zlib if we want zlib, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 02/12] vnc: explain why set_encodings loop is reversed,
Corentin Chary <=
- [Qemu-devel] [PATCH v3 05/12] vnc: adjust compression zstream level, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 08/12] vnc: remove a memory leak in zlib, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 12/12] vnc: tight: add palette encoding, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 07/12] vnc: add buffer_free(), Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 06/12] vnc: don't clear zlib stream on set_encoding, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 10/12] vnc: add basic tight support, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 11/12] vnc: add support for tight fill encoding, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH v3 09/12] vnc: return the number of rectangles, Corentin Chary, 2010/05/19
- Re: [Qemu-devel] [PATCH v3 00/12] *** SUBJECT HERE ***, Corentin Chary, 2010/05/19
- [Qemu-devel] [PATCH 3/3] vnc: add missing target for vnc-encodings-*.o, Corentin Chary, 2010/05/27