diff --git a/profiles/audio/avdtp.c b/profiles/audio/avdtp.c
index 3007053..ea56110 100644
--- a/profiles/audio/avdtp.c
+++ b/profiles/audio/avdtp.c
return session;
}
-struct avdtp *avdtp_get(bdaddr_t *src, bdaddr_t *dst)
+struct avdtp *avdtp_get(struct audio_device *device)
{
struct avdtp *session;
+ 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);
session = avdtp_get_internal(src, dst);
diff --git a/profiles/audio/avdtp.h b/profiles/audio/avdtp.h
index cdf39bf..9117e89 100644
--- a/profiles/audio/avdtp.h
+++ b/profiles/audio/avdtp.h
typedef void (*avdtp_discover_cb_t) (struct avdtp *session, GSList *seps,
struct avdtp_error *err, void *user_data);
-struct avdtp *avdtp_get(bdaddr_t *src, bdaddr_t *dst);
+struct avdtp *avdtp_get(struct audio_device *device);
void avdtp_unref(struct avdtp *session);
struct avdtp *avdtp_ref(struct avdtp *session);
diff --git a/profiles/audio/sink.c b/profiles/audio/sink.c
index 4be3bac..62ec601 100644
--- a/profiles/audio/sink.c
+++ b/profiles/audio/sink.c
struct pending_request *pending;
if (!sink->session)
- sink->session = avdtp_get(&dev->src, &dev->dst);
+ sink->session = avdtp_get(dev);
if (!sink->session) {
DBG("Unable to get a session");
diff --git a/profiles/audio/source.c b/profiles/audio/source.c
index 6713cc4..85aeb4f 100644
--- a/profiles/audio/source.c
+++ b/profiles/audio/source.c
struct pending_request *pending;
if (!source->session)
- source->session = avdtp_get(&dev->src, &dev->dst);
+ source->session = avdtp_get(dev);
if (!source->session) {
DBG("Unable to get a session");
diff --git a/profiles/audio/transport.c b/profiles/audio/transport.c
index abb22b4..3935ade 100644
--- a/profiles/audio/transport.c
+++ b/profiles/audio/transport.c
{
struct a2dp_transport *a2dp = transport->data;
struct media_endpoint *endpoint = transport->endpoint;
- struct audio_device *device = transport->device;
struct a2dp_sep *sep = media_endpoint_get_sep(endpoint);
if (a2dp->session == NULL) {
- a2dp->session = avdtp_get(&device->src, &device->dst);
+ a2dp->session = avdtp_get(transport->device);
if (a2dp->session == NULL)
return 0;
}