From 626e923e36a6d063da72abe1912a520a4e858134 Mon Sep 17 00:00:00 2001 From: Luiz Augusto von Dentz Date: Fri, 3 May 2019 12:41:15 +0300 Subject: [PATCH] a2dp: Fix reconfiguring when there multiple devices connected When there are multiple devices connected streams need to be matched with the sessions they belong. --- profiles/audio/a2dp.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/profiles/audio/a2dp.c b/profiles/audio/a2dp.c index 2ce7c06cb..f89105a8d 100644 --- a/profiles/audio/a2dp.c +++ b/profiles/audio/a2dp.c @@ -1648,6 +1648,10 @@ static int a2dp_reconfig(struct a2dp_channel *chan, const char *sender, tmp->user_data))) return -EPERM; + /* Check if stream is for the channel */ + if (!avdtp_has_stream(chan->session, tmp->stream)) + continue; + err = avdtp_close(chan->session, tmp->stream, FALSE); if (err < 0) { err = avdtp_abort(chan->session, tmp->stream); -- 2.47.3