Diff between d5e4ea74009e98164ad9e16f44a9e09f3fa52d0f and 02877c5e98b81655c0a369c5cffbf975b431ec7a

Changed Files

File Additions Deletions Status
profiles/audio/a2dp.c +13 -1 modified

Full Patch

diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c
index ff384cd..4001ea0 100644
--- a/profiles/audio/a2dp.c
+++ b/profiles/audio/a2dp.c
@@ -583,6 +583,12 @@ static gboolean endpoint_match_codec_ind(struct avdtp *session,
 	return TRUE;
 }
 
+static void reverse_discover(struct avdtp *session, GSList *seps, int err,
+							void *user_data)
+{
+	DBG("err %d", err);
+}
+
 static gboolean endpoint_setconf_ind(struct avdtp *session,
 						struct avdtp_local_sep *sep,
 						struct avdtp_stream *stream,
@@ -638,8 +644,14 @@ static gboolean endpoint_setconf_ind(struct avdtp *session,
 						setup_ref(setup),
 						endpoint_setconf_cb,
 						a2dp_sep->user_data);
-		if (ret == 0)
+		if (ret == 0) {
+			/* Attempt to reverve discover if there are no remote
+			 * SEPs.
+			 */
+			if (queue_isempty(setup->chan->seps))
+				a2dp_discover(session, reverse_discover, NULL);
 			return TRUE;
+		}
 
 		setup_unref(setup);
 		setup->err = g_new(struct avdtp_error, 1);