File 0008-amixer-fix-rounding-of-relative-changes.patch of Package alsa-utils

From da1c24a24c699125aedc8d4f7c97d974b868dacf Mon Sep 17 00:00:00 2001
From: Clemens Ladisch <clemens@ladisch.de>
Date: Tue, 13 Nov 2012 21:54:20 +0100
Subject: [PATCH 8/9] amixer: fix rounding of relative changes

When doing control changes by a relative amount, amixer used the wrong
rounding direction, which would make it possible to stay at the same raw
value if the step was not big enough to reach the next value.

Reported-by: Honza Javorek <jan.javorek@gmail.com>
Signed-off-by: Clemens Ladisch <clemens@ladisch.de>
---
 amixer/amixer.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/amixer/amixer.c b/amixer/amixer.c
index a0a7387..48ed1b2 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -425,10 +425,10 @@ static int set_volume_simple(snd_mixer_elem_t *elem,
 				invalid = 1;
 			if (*p == '+') {
 				val = orig + val;
-				correct = -1;
+				correct = 1;
 			} else {
 				val = orig - val;
-				correct = 1;
+				correct = -1;
 			}
 		}
 		p++;
-- 
1.8.0.1
openSUSE Build Service is sponsored by