[pulseaudio-discuss] [PATCH] alsa-mixer: Fix element channel masks array size.

David Henningsson david.henningsson at canonical.com
Mon Mar 26 04:44:52 PDT 2012


On 03/26/2012 01:35 PM, Tanu Kaskinen wrote:
> Valid channel id range is from 0 to SND_MIXER_SCHN_LAST,
> inclusive, so the array size has to be
> SND_MIXER_SCHN_LAST + 1.

This looks correct. A quick grep for SND_MIXER_SCHN_LAST shows similar 
arrays in alsa-sink and alsa-source, and also, that my subset 
elimination goes up to SND_MIXER_SCHN_LAST exclusive. Maybe that should 
be changed at the same time?

> ---
>   src/modules/alsa/alsa-mixer.h |    2 +-
>   1 files changed, 1 insertions(+), 1 deletions(-)
>
> diff --git a/src/modules/alsa/alsa-mixer.h b/src/modules/alsa/alsa-mixer.h
> index cc2dfc3..ee7221c 100644
> --- a/src/modules/alsa/alsa-mixer.h
> +++ b/src/modules/alsa/alsa-mixer.h
> @@ -145,7 +145,7 @@ struct pa_alsa_element {
>       long volume_limit; /* -1 for no configured limit */
>       double min_dB, max_dB;
>
> -    pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST][2];
> +    pa_channel_position_mask_t masks[SND_MIXER_SCHN_LAST + 1][2];
>       unsigned n_channels;
>
>       pa_channel_position_mask_t merged_mask;



-- 
David Henningsson, Canonical Ltd.
http://launchpad.net/~diwic


More information about the pulseaudio-discuss mailing list