[pulseaudio-discuss] [PATCH v0 5/7] bluetooth: Do not check profile states is device_audio_is_ready()
Mikel Astiz
mikel.astiz.oss at gmail.com
Fri Jan 11 02:07:47 PST 2013
From: Mikel Astiz <mikel.astiz at bmw-carit.de>
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 | 8 +-------
1 file changed, 1 insertion(+), 7 deletions(-)
diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 066c82c..149a476 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -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) {
--
1.7.11.7
More information about the pulseaudio-discuss
mailing list