diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index 2cf9f9c..29f35b4 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
g_free(server);
}
-struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
+struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type,
uint8_t codec, gboolean delay_reporting,
struct a2dp_endpoint *endpoint,
void *user_data, GDestroyNotify destroy,
uint32_t *record_id;
sdp_record_t *record;
- server = find_server(servers, src);
+ server = find_server(servers, adapter_get_address(adapter));
if (server == NULL) {
if (err)
*err = -EPROTONOSUPPORT;
diff --git a/profiles/audio/a2dp.h b/profiles/audio/a2dp.h
index 09e1917..54c3bf3 100644
--- a/profiles/audio/a2dp.h
+++ b/profiles/audio/a2dp.h
int a2dp_sink_register(struct btd_adapter *adapter, GKeyFile *config);
void a2dp_unregister(struct btd_adapter *adapter);
-struct a2dp_sep *a2dp_add_sep(const bdaddr_t *src, uint8_t type,
+struct a2dp_sep *a2dp_add_sep(struct btd_adapter *adapter, uint8_t type,
uint8_t codec, gboolean delay_reporting,
struct a2dp_endpoint *endpoint,
void *user_data, GDestroyNotify destroy,
diff --git a/profiles/audio/media.c b/profiles/audio/media.c
index c18dc4e..905538e 100644
--- a/profiles/audio/media.c
+++ b/profiles/audio/media.c
gboolean delay_reporting,
int *err)
{
- const bdaddr_t *src;
-
- src = adapter_get_address(endpoint->adapter->btd_adapter);
-
- endpoint->sep = a2dp_add_sep(src,
+ endpoint->sep = a2dp_add_sep(endpoint->adapter->btd_adapter,
AVDTP_SEP_TYPE_SOURCE, endpoint->codec,
delay_reporting, &a2dp_endpoint,
endpoint, a2dp_destroy_endpoint, err);
gboolean delay_reporting,
int *err)
{
- const bdaddr_t *src;
-
- src = adapter_get_address(endpoint->adapter->btd_adapter);
-
- endpoint->sep = a2dp_add_sep(src,
+ endpoint->sep = a2dp_add_sep(endpoint->adapter->btd_adapter,
AVDTP_SEP_TYPE_SINK, endpoint->codec,
delay_reporting, &a2dp_endpoint,
endpoint, a2dp_destroy_endpoint, err);