[pulseaudio-commits] 2 commits - src/modules

Tanu Kaskinen tanuk at kemper.freedesktop.org
Thu Sep 18 00:55:33 PDT 2014


 src/modules/bluetooth/module-bluetooth-policy.c |    7 ++-----
 src/modules/bluetooth/module-bluez5-device.c    |    2 ++
 2 files changed, 4 insertions(+), 5 deletions(-)

New commits:
commit eb108b35398ab0c9502e57f541654f41ce24bb1f
Author: Luiz Augusto von Dentz <luiz.von.dentz at intel.com>
Date:   Wed Sep 17 13:05:00 2014 +0300

    bluetooth: Allow policy module to pick 'off' profile
    
    This allow 'off' profile to be choosen when no other profile is available
    which is considered better since it requires less resources than other
    profiles.

diff --git a/src/modules/bluetooth/module-bluetooth-policy.c b/src/modules/bluetooth/module-bluetooth-policy.c
index 8bbda3d..860868f 100644
--- a/src/modules/bluetooth/module-bluetooth-policy.c
+++ b/src/modules/bluetooth/module-bluetooth-policy.c
@@ -143,12 +143,9 @@ static pa_card_profile *find_best_profile(pa_card *card) {
     void *state;
     pa_card_profile *profile;
     pa_card_profile *result = card->active_profile;
-    pa_card_profile *off;
-
-    pa_assert_se(off = pa_hashmap_get(card->profiles, "off"));
 
     PA_HASHMAP_FOREACH(profile, card->profiles, state) {
-        if (profile->available == PA_AVAILABLE_NO || profile == off)
+        if (profile->available == PA_AVAILABLE_NO)
             continue;
 
         if (result == NULL ||
@@ -157,7 +154,7 @@ static pa_card_profile *find_best_profile(pa_card *card) {
             result = profile;
     }
 
-    return result ? result : off;
+    return result;
 }
 
 static pa_hook_result_t profile_available_hook_callback(pa_core *c, pa_card_profile *profile, void *userdata) {

commit 7fac520d8960f2ba2bf1b79d675c03ac6584837f
Author: João Paulo Rechi Vita <jprvita at openbossa.org>
Date:   Wed Sep 17 13:04:59 2014 +0300

    bluetooth: Switch transport state to idle in case of HUP
    
    In case the socket HUP the transport state should be set to idle which
    will indicate the profile is no longer available.

diff --git a/src/modules/bluetooth/module-bluez5-device.c b/src/modules/bluetooth/module-bluez5-device.c
index fdf4078..48e498b 100644
--- a/src/modules/bluetooth/module-bluez5-device.c
+++ b/src/modules/bluetooth/module-bluez5-device.c
@@ -1980,6 +1980,7 @@ static pa_hook_result_t transport_state_changed_cb(pa_bluetooth_discovery *y, pa
 /* Run from main thread context */
 static int device_process_msg(pa_msgobject *obj, int code, void *data, int64_t offset, pa_memchunk *chunk) {
     struct bluetooth_msg *m = BLUETOOTH_MSG(obj);
+    struct userdata *u = m->card->userdata;
 
     switch (code) {
         case BLUETOOTH_MESSAGE_IO_THREAD_FAILED:
@@ -1990,6 +1991,7 @@ static int device_process_msg(pa_msgobject *obj, int code, void *data, int64_t o
             pa_assert_se(pa_card_set_profile(m->card, pa_hashmap_get(m->card->profiles, "off"), false) >= 0);
             break;
         case BLUETOOTH_MESSAGE_STREAM_FD_HUP:
+            pa_bluetooth_transport_set_state(u->transport, PA_BLUETOOTH_TRANSPORT_STATE_IDLE);
             break;
     }
 



More information about the pulseaudio-commits mailing list