alsa-mixer: refactor element_probe and fix >2 channel bug
authorDavid Henningsson <david.henningsson@canonical.com>
Tue, 1 Mar 2016 10:41:55 +0000 (11:41 +0100)
committerDavid Henningsson <david.henningsson@canonical.com>
Tue, 8 Mar 2016 07:37:57 +0000 (08:37 +0100)
commitc87917cf0da9add5c282a1c15831fd481f9fcc22
tree8e5dad2a18c794030f32cbd16f6af26938b5a055
parentf6e1ac2dd2af01088fb9fea85bd57502a214335b
alsa-mixer: refactor element_probe and fix >2 channel bug

By refactoring volume probing into its own function, we can reduce
indentation a lot. Also, if an error occurs during the volume probe,
that volume element is now always skipped (instead of taking down
the entire path with it).

Also, a bug for elements with more than two channels is fixed, as
previously, the volume parsing code was continuing, potentially
referencing somewhere outside the array (which has max two channels).

Signed-off-by: David Henningsson <david.henningsson@canonical.com>
src/modules/alsa/alsa-mixer.c