[pulseaudio-discuss] [PATCH v2 4/7] card: Update preferred_profile for ports when profile changes

David Henningsson david.henningsson at canonical.com
Thu Nov 5 05:27:58 PST 2015



On 2015-10-27 16:09, David Henningsson wrote:
> +static const char* profile_name_for_dir(pa_card_profile *cp, pa_direction_t dir) {
> +    if (dir == PA_DIRECTION_OUTPUT && cp->output_name)
> +        return cp->output_name;
> +    if (dir == PA_DIRECTION_INPUT && cp->input_name)
> +        return cp->input_name;
> +    return cp->name;
> +}

The previous discussion made me think that maybe this should change to 
the below (sorry about the word wrapping) :

static const char* profile_name_for_dir(pa_card_profile *cp, 
pa_direction_t dir) {
     if (cp->output_name || cp->input_name)
         return dir == PA_DIRECTION_OUTPUT ? cp->output_name : 
cp->input_name;
     return cp->name;
}

...but it does not matter, because you will never call 
profile_name_for_dir for a direction with no sinks/sources anyhow.

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


More information about the pulseaudio-discuss mailing list