[pulseaudio-discuss] [RFC PATCH 1/3] alsa: Add "exact-channels" mapping configurability

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Sun Jul 27 05:06:50 PDT 2014


On Fri, 2014-07-25 at 15:31 +0200, David Henningsson wrote:
> +static int mapping_parse_exact_channels(pa_config_parser_state *state) {
> +    pa_alsa_profile_set *ps;
> +    pa_alsa_mapping *m;
> +    int b;
> +
> +    pa_assert(state);
> +
> +    ps = state->userdata;
> +
> +    if (!(m = pa_alsa_mapping_get(ps, state->section))) {
> +        pa_log("[%s:%u] %s invalid in section %s", state->filename, state->lineno, state->lvalue, state->section);
> +        return -1;
> +    }
> +
> +    if ((b = pa_parse_boolean(state->rvalue)) < 0) {
> +        pa_log("[%s:%u] %s has invalid value '%s'", state->filename, state->lineno, state->lvalue, state->section);
> +        return -1;
> +    }
> +
> +    m->exact_channels = !!b;

Unnecessary !!. Converting int to bool works so that only 0 is mapped to
false.

-- 
Tanu



More information about the pulseaudio-discuss mailing list