From patchwork Fri Feb 4 08:05:54 2011 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Corentin Chary X-Patchwork-Id: 81818 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.gnu.org (lists.gnu.org [199.232.76.165]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client did not present a certificate) by ozlabs.org (Postfix) with ESMTPS id 2F857B7106 for ; Fri, 4 Feb 2011 19:13:52 +1100 (EST) Received: from localhost ([127.0.0.1]:60831 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlGn9-0006QK-Pb for incoming@patchwork.ozlabs.org; Fri, 04 Feb 2011 03:13:19 -0500 Received: from [140.186.70.92] (port=49277 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PlGeq-0003e1-NH for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:46 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PlGep-0001gE-Or for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:44 -0500 Received: from smtp5-g21.free.fr ([212.27.42.5]:51075) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PlGep-0001fs-2B for qemu-devel@nongnu.org; Fri, 04 Feb 2011 03:04:43 -0500 Received: from localhost.localdomain (unknown [82.241.209.44]) by smtp5-g21.free.fr (Postfix) with ESMTP id A1BF4D482AE; Fri, 4 Feb 2011 09:04:37 +0100 (CET) From: Corentin Chary To: Anthony Liguori Date: Fri, 4 Feb 2011 09:05:54 +0100 Message-Id: <1296806768-27787-3-git-send-email-corentincj@iksaif.net> X-Mailer: git-send-email 1.7.4 In-Reply-To: <1296806768-27787-1-git-send-email-corentincj@iksaif.net> References: <1296806768-27787-1-git-send-email-corentincj@iksaif.net> X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.6 (newer, 3) X-Received-From: 212.27.42.5 Cc: Corentin Chary , Andre Przywara , Qemu-development List , Alexander Graf Subject: [Qemu-devel] [PATCH v3 02/16] vnc: don't set the quality if lossy encoding are disabled X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: qemu-devel.nongnu.org List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org Errors-To: qemu-devel-bounces+incoming=patchwork.ozlabs.org@nongnu.org This should not change the current behavior, but if any new encoding try to use the tight quality, it will always be set to -1 when lossy encodings are disabled. Signed-off-by: Corentin Chary --- ui/vnc.c | 4 +++- 1 files changed, 3 insertions(+), 1 deletions(-) diff --git a/ui/vnc.c b/ui/vnc.c index 560b98d..9c5c5b3 100644 --- a/ui/vnc.c +++ b/ui/vnc.c @@ -1780,7 +1780,9 @@ static void set_encodings(VncState *vs, int32_t *encodings, size_t n_encodings) vs->tight.compression = (enc & 0x0F); break; case VNC_ENCODING_QUALITYLEVEL0 ... VNC_ENCODING_QUALITYLEVEL0 + 9: - vs->tight.quality = (enc & 0x0F); + if (vs->vd->lossy) { + vs->tight.quality = (enc & 0x0F); + } break; default: VNC_DEBUG("Unknown encoding: %d (0x%.8x): %d\n", i, enc, enc);