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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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



[Index of Archives]     [Linux Audio Users]     [AMD Graphics]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux