aboutsummaryrefslogtreecommitdiff
path: root/audio
diff options
context:
space:
mode:
authorArun Raghavan <arun.raghavan@collabora.co.uk>2011-03-17 01:35:57 +0530
committerJohan Hedberg <johan.hedberg@nokia.com>2011-03-18 11:37:53 +0200
commite70fb63e463316ada715c1dbc03e2665c0009028 (patch)
treeb92c07e6c4ec9cf6d624e356ef6eb3063bb6443e /audio
parent2c0c9662d010a7df559778586d1464b57bf83eea (diff)
downloadbluez-e70fb63e463316ada715c1dbc03e2665c0009028.tar.gz
Recalculate remote SEP if the codec type changes
This forces recalculating the remote SEP if the local SEP's codec type is no longer the same as the remote SEP's codec type. This can happen after we issue a BT_STOP_STREAM+BT_CLOSE followed by a BT_SET_CONFIGURATION with a new SEID.
Diffstat (limited to 'audio')
-rw-r--r--audio/a2dp.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 8c3698aa..ea4805cb 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,