[pulseaudio-discuss] [PATCH v0 19/20] bluetooth-experimental: Fake input-output A2DP ports

Mikel Astiz mikel.astiz.oss at gmail.com
Wed Aug 22 01:08:32 PDT 2012


From: Mikel Astiz <mikel.astiz at bmw-carit.de>

We must fake input-output A2DP ports in order to handle the
"hfgw"->"a2dp_source" transition in module-switch-on-port-available.
---
 src/modules/bluetooth/module-bluetooth-device.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 6d51cf7..270132f 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -2194,7 +2194,7 @@ static void create_ports_for_profile(struct userdata *u, const pa_bluetooth_devi
             pa_assert_se(port = pa_device_port_new(u->core, "a2dp-output", _("Bluetooth High Quality (A2DP)"), 0));
             pa_assert_se(pa_hashmap_put(card_new_data->ports, port->name, port) >= 0);
             port->is_output = 1;
-            port->is_input = 0;
+            port->is_input = 1; /* Fake value to be friendly with module-switch-on-port-available */
             port->priority = profile->priority * 100;
             port->available = audio_state_to_availability(device->audio_sink_state);
             pa_hashmap_put(port->profiles, profile->name, profile);
@@ -2203,7 +2203,7 @@ static void create_ports_for_profile(struct userdata *u, const pa_bluetooth_devi
         case PROFILE_A2DP_SOURCE:
             pa_assert_se(port = pa_device_port_new(u->core, "a2dp-input", _("Bluetooth High Quality (A2DP)"), 0));
             pa_assert_se(pa_hashmap_put(card_new_data->ports, port->name, port) >= 0);
-            port->is_output = 0;
+            port->is_output = 1; /* Fake value to be friendly with module-switch-on-port-available */
             port->is_input = 1;
             port->priority = profile->priority * 100;
             port->available = audio_state_to_availability(device->audio_source_state);
-- 
1.7.7.6



More information about the pulseaudio-discuss mailing list