src/modules/bluetooth/module-bluetooth-device.c | 22 +++++++++++++++++----- 1 file changed, 17 insertions(+), 5 deletions(-)
New commits: commit 0c6b60d567ecac94d5435cf19e691c1c793597be Author: Mikel Astiz <mikel.as...@bmw-carit.de> Date: Mon May 20 11:48:33 2013 +0200 bluetooth: Fix missing port->profile association Commit 17b3cb954b179392e80b0a46d8f2ba4693aec386 merged Bluetooth ports into two ports (one for input, one for output) but the association between ports and profiles was lost. BugLink: https://bugs.freedesktop.org/show_bug.cgi?id=64713 diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 4b9cb2b..c82cb53 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -2156,10 +2156,16 @@ static void create_card_ports(struct userdata *u, pa_hashmap *ports) { } /* Run from main thread */ -static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid) { +static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid, pa_hashmap *ports) { + pa_device_port *input_port, *output_port; pa_card_profile *p = NULL; enum profile *d; + pa_assert(u->input_port_name); + pa_assert(u->output_port_name); + pa_assert_se(input_port = pa_hashmap_get(ports, u->input_port_name)); + pa_assert_se(output_port = pa_hashmap_get(ports, u->output_port_name)); + if (pa_streq(uuid, A2DP_SINK_UUID)) { p = pa_card_profile_new("a2dp", _("High Fidelity Playback (A2DP)"), sizeof(enum profile)); p->priority = 10; @@ -2167,6 +2173,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid p->n_sources = 0; p->max_sink_channels = 2; p->max_source_channels = 0; + pa_hashmap_put(output_port->profiles, p->name, p); d = PA_CARD_PROFILE_DATA(p); *d = PROFILE_A2DP; @@ -2177,6 +2184,7 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid p->n_sources = 1; p->max_sink_channels = 0; p->max_source_channels = 2; + pa_hashmap_put(input_port->profiles, p->name, p); d = PA_CARD_PROFILE_DATA(p); *d = PROFILE_A2DP_SOURCE; @@ -2187,6 +2195,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid p->n_sources = 1; p->max_sink_channels = 1; p->max_source_channels = 1; + pa_hashmap_put(input_port->profiles, p->name, p); + pa_hashmap_put(output_port->profiles, p->name, p); d = PA_CARD_PROFILE_DATA(p); *d = PROFILE_HSP; @@ -2197,6 +2207,8 @@ static pa_card_profile *create_card_profile(struct userdata *u, const char *uuid p->n_sources = 1; p->max_sink_channels = 1; p->max_source_channels = 1; + pa_hashmap_put(input_port->profiles, p->name, p); + pa_hashmap_put(output_port->profiles, p->name, p); d = PA_CARD_PROFILE_DATA(p); *d = PROFILE_HFGW; @@ -2257,7 +2269,7 @@ static int add_card(struct userdata *u) { create_card_ports(u, data.ports); PA_LLIST_FOREACH(uuid, device->uuids) { - p = create_card_profile(u, uuid->uuid); + p = create_card_profile(u, uuid->uuid, data.ports); if (!p) continue; @@ -2364,7 +2376,7 @@ static pa_hook_result_t uuid_added_cb(pa_bluetooth_discovery *y, const struct pa if (data->device != u->device) return PA_HOOK_OK; - p = create_card_profile(u, data->uuid); + p = create_card_profile(u, data->uuid, u->card->ports); if (!p) return PA_HOOK_OK; commit 192d6c91edde5af58516aa1f999f4b46bf58b6e0 Author: Mikel Astiz <mikel.as...@bmw-carit.de> Date: Mon May 20 11:48:32 2013 +0200 bluetooth: Create ports before card profiles Both operations are currently independent and their order can therefore be swapped. diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c index 290f5ce..4b9cb2b 100644 --- a/src/modules/bluetooth/module-bluetooth-device.c +++ b/src/modules/bluetooth/module-bluetooth-device.c @@ -2254,6 +2254,8 @@ static int add_card(struct userdata *u) { return -1; } + create_card_ports(u, data.ports); + PA_LLIST_FOREACH(uuid, device->uuids) { p = create_card_profile(u, uuid->uuid); @@ -2270,8 +2272,6 @@ static int add_card(struct userdata *u) { pa_assert(!pa_hashmap_isempty(data.profiles)); - create_card_ports(u, data.ports); - p = pa_card_profile_new("off", _("Off"), sizeof(enum profile)); p->available = PA_AVAILABLE_YES; d = PA_CARD_PROFILE_DATA(p); _______________________________________________ pulseaudio-commits mailing list pulseaudio-commits@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/pulseaudio-commits