[pulseaudio-discuss] [RFC 03/24] bluetooth: Improve code readability

jprvita at gmail.com jprvita at gmail.com
Tue Mar 26 22:16:42 PDT 2013


From: João Paulo Rechi Vita <jprvita at openbossa.org>

---
 src/modules/bluetooth/bluetooth-util.c | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/src/modules/bluetooth/bluetooth-util.c b/src/modules/bluetooth/bluetooth-util.c
index 32566f2..7ae12fc 100644
--- a/src/modules/bluetooth/bluetooth-util.c
+++ b/src/modules/bluetooth/bluetooth-util.c
@@ -2068,20 +2068,18 @@ static DBusHandlerResult endpoint_handler(DBusConnection *c, DBusMessage *m, voi
     struct pa_bluetooth_discovery *y = userdata;
     DBusMessage *r = NULL;
     DBusError e;
-    const char *path;
-    const char *interface;
+    const char *path, *interface, *member;
 
     pa_assert(y);
 
-    interface = y->version == BLUEZ_VERSION_4 ? "org.bluez.MediaEndpoint" : "org.bluez.MediaEndpoint1";
+    path = dbus_message_get_path(m);
+    interface = dbus_message_get_interface(m);
+    member = dbus_message_get_member(m);
 
-    pa_log_debug("dbus: interface=%s, path=%s, member=%s\n",
-            dbus_message_get_interface(m),
-            dbus_message_get_path(m),
-            dbus_message_get_member(m));
+    pa_log_debug("dbus: path=%s, interface=%s, member=%s", path, interface, member);
 
-    path = dbus_message_get_path(m);
     dbus_error_init(&e);
+    interface = y->version == BLUEZ_VERSION_4 ? "org.bluez.MediaEndpoint" : "org.bluez.MediaEndpoint1";
 
     if (!pa_streq(path, A2DP_SOURCE_ENDPOINT) && !pa_streq(path, A2DP_SINK_ENDPOINT) && !pa_streq(path, HFP_AG_ENDPOINT) &&
         !pa_streq(path, HFP_HS_ENDPOINT))
-- 
1.7.11.7



More information about the pulseaudio-discuss mailing list