[pulseaudio-commits] 2 commits - src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Tue Aug 21 09:50:54 PDT 2012


 src/modules/bluetooth/module-bluetooth-device.c |   12 +++++++-----
 1 file changed, 7 insertions(+), 5 deletions(-)

New commits:
commit 33e5802df206b5d47696fcbdff64d5355cc02e8f
Author: Mikel Astiz <mikel.astiz at bmw-carit.de>
Date:   Thu Aug 16 13:08:29 2012 +0200

    bluetooth: Fix missing state checks for a2dp_source
    
    Profile a2dp_source, just like any other card profile, should have
    state guards when the profile is being changed. If the BlueZ interface
    is not connected, the profile should be set to "off".

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 60881fc..5ef5487 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1969,7 +1969,10 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
         pa_log_warn("HSP is not connected, refused to switch profile");
         return -PA_ERR_IO;
     } else if (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP) {
-        pa_log_warn("A2DP is not connected, refused to switch profile");
+        pa_log_warn("A2DP Sink is not connected, refused to switch profile");
+        return -PA_ERR_IO;
+    } else if (device->audio_source_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP_SOURCE) {
+        pa_log_warn("A2DP Source is not connected, refused to switch profile");
         return -PA_ERR_IO;
     } else if (device->hfgw_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HFGW) {
         pa_log_warn("HandsfreeGateway is not connected, refused to switch profile");
@@ -2225,6 +2228,7 @@ static int add_card(struct userdata *u, const pa_bluetooth_device *device) {
 
     if ((device->headset_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HSP) ||
         (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP) ||
+        (device->audio_source_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP_SOURCE) ||
         (device->hfgw_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HFGW)) {
         pa_log_warn("Default profile not connected, selecting off profile");
         u->card->active_profile = pa_hashmap_get(u->card->profiles, "off");

commit d59275599af34cb286acd6540e36afe861511fbb
Author: Mikel Astiz <mikel.astiz at bmw-carit.de>
Date:   Thu Aug 16 13:08:28 2012 +0200

    bluetooth: Minor style fix
    
    Else clause should be in the same line as the closing brace.

diff --git a/src/modules/bluetooth/module-bluetooth-device.c b/src/modules/bluetooth/module-bluetooth-device.c
index 19d62a6..60881fc 100644
--- a/src/modules/bluetooth/module-bluetooth-device.c
+++ b/src/modules/bluetooth/module-bluetooth-device.c
@@ -1968,12 +1968,10 @@ static int card_set_profile(pa_card *c, pa_card_profile *new_profile) {
     if (device->headset_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HSP) {
         pa_log_warn("HSP is not connected, refused to switch profile");
         return -PA_ERR_IO;
-    }
-    else if (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP) {
+    } else if (device->audio_sink_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_A2DP) {
         pa_log_warn("A2DP is not connected, refused to switch profile");
         return -PA_ERR_IO;
-    }
-    else if (device->hfgw_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HFGW) {
+    } else if (device->hfgw_state < PA_BT_AUDIO_STATE_CONNECTED && *d == PROFILE_HFGW) {
         pa_log_warn("HandsfreeGateway is not connected, refused to switch profile");
         return -PA_ERR_IO;
     }



More information about the pulseaudio-commits mailing list