OSDN Git Service

mixer: simple - Unify simple_none: base_len() exception handling
authorHans de Goede <hdegoede@redhat.com>
Sun, 28 Feb 2021 16:13:02 +0000 (17:13 +0100)
committerJaroslav Kysela <perex@perex.cz>
Fri, 5 Mar 2021 20:11:19 +0000 (21:11 +0100)
commit86b9c67774bc1d068cc2943fec697383ba9b1881
tree58d4975fc080381b8304692c2925891efa32d40e
parent33ddf2e1c7d9154e66376398a304c35a50e35d7a
mixer: simple - Unify simple_none: base_len() exception handling

Unify simple_none: base_len() exception handling:

1. In the "Input Source" and "3D Control" cases the base-name is the same
   as the full-name and base_len() simply returns strlen(name).
   Instead of returning 0 when the type is unknown, set the type to
   CTL_SINGLE and return strlen(name). This allows removing the special
   case for base_len() returning 0 in simple_event_add().

2. Move the special handling for "Capture Volume" and "Capture Switch"
   from simple_event_add() to base_len(), so that we handle all exceptions
   inside base_len(). Instead of handling some special cases in base_len()
   and other special cases in simple_event_add().

[jk - moved the "Capture Volume" and "Capture Switch" to "Input Source"
exceptions]

Signed-off-by: Hans de Goede <hdegoede@redhat.com>
Signed-off-by: Jaroslav Kysela <perex@perex.cz>
src/mixer/simple_none.c