[pulseaudio-discuss] [PATCH] alsa-mixer: Take channel mask of volume element into account when finding a subset path

Maarten Bosmans mkbosmans at gmail.com
Wed Oct 19 11:43:06 PDT 2011


---
 src/modules/alsa/alsa-mixer.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/modules/alsa/alsa-mixer.c b/src/modules/alsa/alsa-mixer.c
index 3f27fdc..f390119 100644
--- a/src/modules/alsa/alsa-mixer.c
+++ b/src/modules/alsa/alsa-mixer.c
@@ -2956,6 +2956,10 @@ static pa_bool_t element_is_subset(pa_alsa_element *a, pa_alsa_element *b, snd_m
     /* Check the volume_use */
     if (a->volume_use != PA_ALSA_VOLUME_IGNORE) {
 
+        /* If b cannot control at least the channels of a, a is not a subset of b */
+        if (a->merged_mask & ~b->merged_mask)
+          return FALSE;
+
         /* "Constant" is subset of "Constant" only when their constant values are equal */
         if (a->volume_use == PA_ALSA_VOLUME_CONSTANT && b->volume_use == PA_ALSA_VOLUME_CONSTANT && a->constant_volume != b->constant_volume)
             return FALSE;
-- 
1.7.4.1



More information about the pulseaudio-discuss mailing list