[pulseaudio-discuss] [PATCH 49/56] bluetooth: Create source for BlueZ 5 cards

Tanu Kaskinen tanu.kaskinen at linux.intel.com
Tue Jul 23 06:35:03 PDT 2013


On Fri, 2013-07-12 at 15:07 -0300, jprvita at gmail.com wrote:
>  /* Run from main thread */
> +static int add_source(struct userdata *u) {
> +    pa_source_new_data data;
> +
> +    pa_assert(u->transport);
> +
> +    pa_source_new_data_init(&data);
> +    data.module = u->module;
> +    data.card = u->card;
> +    data.driver = __FILE__;
> +    data.name = pa_sprintf_malloc("bluez_source.%s", u->device->address);
> +    data.namereg_fail = false;
> +    pa_proplist_sets(data.proplist, "bluetooth.protocol", pa_bluetooth_profile_to_string(u->profile));
> +    pa_source_new_data_set_sample_spec(&data, &u->sample_spec);
> +
> +    connect_ports(u, &data, PA_DIRECTION_INPUT);
> +
> +    if (!u->transport_acquired)
> +        switch (u->profile) {
> +            case PROFILE_A2DP_SOURCE:
> +                data.suspend_cause = PA_SUSPEND_USER;
> +                break;
> +            case PROFILE_A2DP_SINK:
> +            case PROFILE_OFF:
> +                pa_assert_not_reached(); /* Profile switch should have failed */

This comment is correct for neither A2DP_SINK nor OFF.

The same comment is also in add_sink(). There the comment is correct
only for A2DP_SINK. I propose you remove the comment from add_source()
and move it under PROFILE_A2DP_SINK in add_sink().

-- 
Tanu



More information about the pulseaudio-discuss mailing list