diff --git a/audio/a2dp.c b/audio/a2dp.c
index db4bb13..4567ce0 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
GSList **l;
uint32_t *record_id;
sdp_record_t *record;
- struct avdtp_sep_ind *ind;
server = find_server(servers, src);
if (server == NULL) {
sep = g_new0(struct a2dp_sep, 1);
- if (endpoint) {
- ind = &endpoint_ind;
- goto proceed;
- }
-
- ind = (codec == A2DP_CODEC_MPEG12) ? &mpeg_ind : &sbc_ind;
-
-proceed:
sep->lsep = avdtp_register_sep(&server->src, type,
AVDTP_MEDIA_TYPE_AUDIO, codec,
- delay_reporting, ind, &cfm, sep);
+ delay_reporting, &endpoint_ind,
+ &cfm, sep);
+
if (sep->lsep == NULL) {
g_free(sep);
if (err)
a2dp_unregister_sep(sep);
}
-struct a2dp_sep *a2dp_get(struct avdtp *session,
- struct avdtp_remote_sep *rsep)
-{
- GSList *l;
- struct a2dp_server *server;
- struct avdtp_service_capability *cap;
- struct avdtp_media_codec_capability *codec_cap = NULL;
- bdaddr_t src;
-
- avdtp_get_peers(session, &src, NULL);
- server = find_server(servers, &src);
- if (!server)
- return NULL;
-
- cap = avdtp_get_codec(rsep);
- codec_cap = (void *) cap->data;
-
- if (avdtp_get_type(rsep) == AVDTP_SEP_TYPE_SINK)
- l = server->sources;
- else
- l = server->sinks;
-
- for (; l != NULL; l = l->next) {
- struct a2dp_sep *sep = l->data;
-
- if (sep->locked)
- continue;
-
- if (sep->codec != codec_cap->media_codec_type)
- continue;
-
- if (!sep->stream || avdtp_has_stream(session, sep->stream))
- return sep;
- }
-
- return NULL;
-}
-
static uint8_t default_bitpool(uint8_t freq, uint8_t mode)
{
switch (freq) {
finalize_select(setup);
}
-static gboolean auto_select(gpointer data)
-{
- struct a2dp_setup *setup = data;
-
- finalize_select(setup);
-
- return FALSE;
-}
-
static struct a2dp_sep *a2dp_find_sep(struct avdtp *session, GSList *list,
const char *sender)
{
goto fail;
}
- /* FIXME: Remove auto select when it is not longer possible to register
- endpoint in the configuration file */
- if (sep->endpoint == NULL) {
- if (!select_capabilities(session, setup->rsep,
- &setup->caps)) {
- error("Unable to auto select remote SEP capabilities");
- goto fail;
- }
-
- g_idle_add(auto_select, setup);
-
- return cb_data->id;
- }
-
service = avdtp_get_codec(setup->rsep);
codec = (struct avdtp_media_codec_capability *) service->data;
diff --git a/audio/a2dp.h b/audio/a2dp.h
index 887c5ac..3a677aa 100644
--- a/audio/a2dp.h
+++ b/audio/a2dp.h
int *err);
void a2dp_remove_sep(struct a2dp_sep *sep);
-struct a2dp_sep *a2dp_get(struct avdtp *session, struct avdtp_remote_sep *sep);
-
unsigned int a2dp_select_capabilities(struct avdtp *session,
uint8_t type, const char *sender,
a2dp_select_cb_t cb,