From a8b557b30242002af6189a587d57fb40f11dda95 Mon Sep 17 00:00:00 2001 From: Takashi Iwai Date: Tue, 17 Feb 2009 17:28:13 +0100 Subject: pulse: Add numid check in ctl plugin Added the check of non-zero numid and optimize the look-up for the element. Signed-off-by: Takashi Iwai --- pulse/ctl_pulse.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/pulse/ctl_pulse.c b/pulse/ctl_pulse.c index 8a5546c..c6cf9e2 100644 --- a/pulse/ctl_pulse.c +++ b/pulse/ctl_pulse.c @@ -229,6 +229,11 @@ static snd_ctl_ext_key_t pulse_find_elem(snd_ctl_ext_t * ext, const snd_ctl_elem_id_t * id) { const char *name; + unsigned int numid; + + numid = snd_ctl_elem_id_get_numid(id); + if (numid > 0 && numid <= 4) + return numid - 1; name = snd_ctl_elem_id_get_name(id); -- cgit