SHA256
1
0
forked from pool/alsa-utils
alsa-utils/0014-amixer-Make-dB-case-insensitive-in-set-commands.patch
Cristian Rodríguez 39e6584f17 Accepting request 264172 from home:tiwai:branches:multimedia:libs
- Backport upstream fixes: rubustify dB value handling in amixer
  0014-amixer-Make-dB-case-insensitive-in-set-commands.patch
  0015-amixer-Parse-the-value-more-strictly.patch

OBS-URL: https://build.opensuse.org/request/show/264172
OBS-URL: https://build.opensuse.org/package/show/multimedia:libs/alsa-utils?expand=0&rev=110
2014-12-08 05:09:42 +00:00

30 lines
854 B
Diff

From 45a334e71ca9b4402fb731a934f7455cec5b0121 Mon Sep 17 00:00:00 2001
From: Takashi Iwai <tiwai@suse.de>
Date: Sun, 23 Nov 2014 09:40:07 +0100
Subject: [PATCH 14/15] amixer: Make "dB" case-insensitive in set commands
We don't have to be necessarily too strict about case-sensitivity of
"dB" suffix used in set commands.
Signed-off-by: Takashi Iwai <tiwai@suse.de>
---
amixer/amixer.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/amixer/amixer.c b/amixer/amixer.c
index cf82892bfa2f..6a2fdb96c62f 100644
--- a/amixer/amixer.c
+++ b/amixer/amixer.c
@@ -346,7 +346,7 @@ static int set_volume_simple(snd_mixer_elem_t *elem,
if (*p == '%') {
percent = 1;
p++;
- } else if (p[0] == 'd' && p[1] == 'B') {
+ } else if (toupper(p[0]) == 'D' && toupper(p[1]) == 'B') {
vol_type = VOL_DB;
p += 2;
scale = 100;
--
2.2.0