Diff between 2cdebb26998ff0819e306f45fa3e8af617a5a5ce and 0e4651f50626dd84584744741a3ad95daec4103f

Changed Files

File Additions Deletions Status
profiles/audio/avctp.c +7 -1 modified
profiles/audio/avctp.h +1 -1 modified
profiles/audio/avrcp.c +1 -1 modified
profiles/audio/control.c +1 -1 modified

Full Patch

diff --git a/profiles/audio/avctp.c b/profiles/audio/avctp.c
index a9ac9fe..565efdb 100644
--- a/profiles/audio/avctp.c
+++ b/profiles/audio/avctp.c
@@ -1671,7 +1671,13 @@ void avctp_disconnect(struct avctp *session)
 	avctp_set_state(session, AVCTP_STATE_DISCONNECTED);
 }
 
-struct avctp *avctp_get(const bdaddr_t *src, const bdaddr_t *dst)
+struct avctp *avctp_get(struct audio_device *device)
 {
+	const bdaddr_t *src;
+	const bdaddr_t *dst;
+
+	src = adapter_get_address(device_get_adapter(device->btd_dev));
+	dst = device_get_address(device->btd_dev);
+
 	return avctp_get_internal(src, dst);
 }
diff --git a/profiles/audio/avctp.h b/profiles/audio/avctp.h
index 7314a04..2597e6e 100644
--- a/profiles/audio/avctp.h
+++ b/profiles/audio/avctp.h
@@ -94,7 +94,7 @@ int avctp_register(const bdaddr_t *src, gboolean master);
 void avctp_unregister(const bdaddr_t *src);
 
 struct avctp *avctp_connect(struct audio_device *device);
-struct avctp *avctp_get(const bdaddr_t *src, const bdaddr_t *dst);
+struct avctp *avctp_get(struct audio_device *device);
 int avctp_connect_browsing(struct avctp *session);
 void avctp_disconnect(struct avctp *session);
 
diff --git a/profiles/audio/avrcp.c b/profiles/audio/avrcp.c
index ffa3519..272f942 100644
--- a/profiles/audio/avrcp.c
+++ b/profiles/audio/avrcp.c
@@ -2265,7 +2265,7 @@ void avrcp_disconnect(struct audio_device *dev)
 {
 	struct avctp *session;
 
-	session = avctp_get(&dev->src, &dev->dst);
+	session = avctp_get(dev);
 	if (!session)
 		return;
 
diff --git a/profiles/audio/control.c b/profiles/audio/control.c
index 31bbcf9..1600fce 100644
--- a/profiles/audio/control.c
+++ b/profiles/audio/control.c
@@ -110,7 +110,7 @@ static void state_changed(struct audio_device *dev, avctp_state_t old_state,
 		if (control->session)
 			break;
 
-		control->session = avctp_get(&dev->src, &dev->dst);
+		control->session = avctp_get(dev);
 
 		break;
 	case AVCTP_STATE_CONNECTED: