From 29d3944a4099800ed3c27e3389acc5c7eb326805 Mon Sep 17 00:00:00 2001 From: Johan Hedberg Date: Fri, 7 Dec 2007 08:14:01 +0000 Subject: Make sure remote SEP cache and active streams stay in sync --- audio/avdtp.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) (limited to 'audio/avdtp.c') diff --git a/audio/avdtp.c b/audio/avdtp.c index 98cce35f..955576b7 100644 --- a/audio/avdtp.c +++ b/audio/avdtp.c @@ -1812,6 +1812,7 @@ static gboolean avdtp_discover_resp(struct avdtp *session, struct discover_resp *resp, int size) { int sep_count, i, isize = sizeof(struct seid_info); + struct avdtp_stream *stream; sep_count = (size - sizeof(struct avdtp_header)) / isize; @@ -1824,16 +1825,17 @@ static gboolean avdtp_discover_resp(struct avdtp *session, resp->seps[i].seid, resp->seps[i].type, resp->seps[i].media_type, resp->seps[i].inuse); + stream = find_stream_by_rseid(session, resp->seps[i].seid); + sep = find_remote_sep(session->seps, resp->seps[i].seid); if (!sep) { - if (resp->seps[i].inuse && - !find_stream_by_rseid(session, - resp->seps[i].seid)) + if (resp->seps[i].inuse && !stream) continue; sep = g_new0(struct avdtp_remote_sep, 1); session->seps = g_slist_append(session->seps, sep); } + sep->stream = stream; sep->seid = resp->seps[i].seid; sep->type = resp->seps[i].type; sep->media_type = resp->seps[i].media_type; -- cgit