Diff between ef50fbe4387ab76a55e37dd618bcdad9736d7217 and 5202b838b8cf33f04d1992db50d4bc8a146358b9

Changed Files

File Additions Deletions Status
profiles/audio/a2dp.c +8 -6 modified
profiles/audio/a2dp.h +2 -2 modified
profiles/audio/manager.c +2 -2 modified
profiles/audio/sink.c +3 -2 modified
profiles/audio/source.c +3 -2 modified

Full Patch

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 66037f5..db2a382 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -37,6 +37,8 @@
 #include <bluetooth/sdp.h>
 #include <bluetooth/sdp_lib.h>
 
+#include "../src/adapter.h"
+
 #include "log.h"
 #include "device.h"
 #include "manager.h"
@@ -1179,15 +1181,15 @@ static struct a2dp_server *a2dp_server_register(const bdaddr_t *src,
 	return server;
 }
 
-int a2dp_source_register(const bdaddr_t *src, GKeyFile *config)
+int a2dp_source_register(struct btd_adapter *adapter, GKeyFile *config)
 {
 	struct a2dp_server *server;
 
-	server = find_server(servers, src);
+	server = find_server(servers, adapter_get_address(adapter));
 	if (server != NULL)
 		goto done;
 
-	server = a2dp_server_register(src, config);
+	server = a2dp_server_register(adapter_get_address(adapter), config);
 	if (server == NULL)
 		return -EPROTONOSUPPORT;
 
@@ -1197,15 +1199,15 @@ done:
 	return 0;
 }
 
-int a2dp_sink_register(const bdaddr_t *src, GKeyFile *config)
+int a2dp_sink_register(struct btd_adapter *adapter, GKeyFile *config)
 {
 	struct a2dp_server *server;
 
-	server = find_server(servers, src);
+	server = find_server(servers, adapter_get_address(adapter));
 	if (server != NULL)
 		goto done;
 
-	server = a2dp_server_register(src, config);
+	server = a2dp_server_register(adapter_get_address(adapter), config);
 	if (server == NULL)
 		return -EPROTONOSUPPORT;
 
diff --git a/profiles/audio/a2dp.h b/profiles/audio/a2dp.h
index f0e3ee6..bd3d590 100644
--- a/profiles/audio/a2dp.h
+++ b/profiles/audio/a2dp.h
@@ -64,8 +64,8 @@ typedef void (*a2dp_stream_cb_t) (struct avdtp *session,
 					struct avdtp_error *err,
 					void *user_data);
 
-int a2dp_source_register(const bdaddr_t *src, GKeyFile *config);
-int a2dp_sink_register(const bdaddr_t *src, GKeyFile *config);
+int a2dp_source_register(struct btd_adapter *adapter, GKeyFile *config);
+int a2dp_sink_register(struct btd_adapter *adapter, GKeyFile *config);
 void a2dp_unregister(const bdaddr_t *src);
 
 struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
diff --git a/profiles/audio/manager.c b/profiles/audio/manager.c
index 0f6a4f7..4c74753 100644
--- a/profiles/audio/manager.c
+++ b/profiles/audio/manager.c
@@ -337,7 +337,7 @@ static int a2dp_source_server_probe(struct btd_profile *p,
 
 	audio_adapter_unref(adp); /* Referenced by a2dp server */
 
-	return a2dp_source_register(adapter_get_address(adapter), config);
+	return a2dp_source_register(adapter, config);
 }
 
 static int a2dp_sink_server_probe(struct btd_profile *p,
@@ -354,7 +354,7 @@ static int a2dp_sink_server_probe(struct btd_profile *p,
 
 	audio_adapter_unref(adp); /* Referenced by a2dp server */
 
-	return a2dp_sink_register(adapter_get_address(adapter), config);
+	return a2dp_sink_register(adapter, config);
 }
 
 static int avrcp_server_probe(struct btd_profile *p,
diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 02e1a65..8c49961 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
@@ -39,6 +39,9 @@
 
 #include "log.h"
 
+#include "../src/adapter.h"
+#include "../src/device.h"
+
 #include "device.h"
 #include "avdtp.h"
 #include "media.h"
@@ -47,8 +50,6 @@
 #include "manager.h"
 #include "sink.h"
 #include "dbus-common.h"
-#include "../src/adapter.h"
-#include "../src/device.h"
 
 #define STREAM_SETUP_RETRY_TIMER 2
 
diff --git a/profiles/audio/source.c b/profiles/audio/source.c
index da312d4..3c9143c 100644
--- a/profiles/audio/source.c
+++ b/profiles/audio/source.c
@@ -40,6 +40,9 @@
 
 #include "log.h"
 
+#include "../src/adapter.h"
+#include "../src/device.h"
+
 #include "device.h"
 #include "avdtp.h"
 #include "media.h"
@@ -48,8 +51,6 @@
 #include "manager.h"
 #include "source.h"
 #include "dbus-common.h"
-#include "../src/adapter.h"
-#include "../src/device.h"
 
 #define STREAM_SETUP_RETRY_TIMER 2