]> code.delx.au - pulseaudio/commitdiff
bluetooth: Do not check profile states is device_audio_is_ready()
authorMikel Astiz <mikel.astiz@bmw-carit.de>
Fri, 11 Jan 2013 10:07:47 +0000 (11:07 +0100)
committerTanu Kaskinen <tanuk@iki.fi>
Fri, 11 Jan 2013 19:47:57 +0000 (21:47 +0200)
The function is used to make sure some basic information has already
been gathered before the device is being used. At this point profile
states can be ignored, since their initial value will be
PA_BT_AUDIO_STATE_INVALID and thus effectively similar to
PA_BT_AUDIO_STATE_DISCONNECTED due to audio_state_to_transport_state().

The change should make no difference given that the behavior of
pa_bluetooth_device_any_audio_connected() doesn't change: by the time
TRUE is returned, a transport needs to exist. This means a profile
will exist in CONNECTING or CONNECTED state and thus the old
implementation of device_audio_is_ready() would also have returned TRUE.

src/modules/bluetooth/bluetooth-util.c

index 066c82c49ccbba4700adb4ac8310a46510b9c955..149a476953ff108c1b03d1703fe4cf74ed833b12 100644 (file)
@@ -235,18 +235,12 @@ static void device_free(pa_bluetooth_device *d) {
 }
 
 static pa_bool_t device_is_audio_ready(const pa_bluetooth_device *d) {
-    unsigned i;
-
     pa_assert(d);
 
     if (!d->device_info_valid || d->audio_state == PA_BT_AUDIO_STATE_INVALID)
         return false;
 
-    for (i = 0; i < PA_BLUETOOTH_PROFILE_COUNT; i++)
-        if (d->profile_state[i] != PA_BT_AUDIO_STATE_INVALID)
-            return true;
-
-    return false;
+    return true;
 }
 
 static const char *check_variant_property(DBusMessageIter *i) {