Diff between 2c0c9662d010a7df559778586d1464b57bf83eea and e70fb63e463316ada715c1dbc03e2665c0009028

Changed Files

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

Full Patch

diff --git a/audio/a2dp.c b/audio/a2dp.c
index 8c3698a..ea4805c 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -1058,8 +1058,15 @@ static gboolean a2dp_reconfigure(gpointer data)
 	struct a2dp_setup *setup = data;
 	struct a2dp_sep *sep = setup->sep;
 	int posix_err;
+	struct avdtp_media_codec_capability *rsep_codec;
+	struct avdtp_service_capability *cap;
 
-	if (!setup->rsep)
+	if (setup->rsep) {
+		cap = avdtp_get_codec(setup->rsep);
+		rsep_codec = (struct avdtp_media_codec_capability *) cap->data;
+	}
+
+	if (!setup->rsep || sep->codec != rsep_codec->media_codec_type)
 		setup->rsep = avdtp_find_remote_sep(setup->session, sep->lsep);
 
 	posix_err = avdtp_set_configuration(setup->session, setup->rsep,