Finalize discovery if all stream end points are In Use
PATCH 1/1 Finalize discovery if all stream end points are In Use
When handling the discover response, if all stream end points are in use, then we must finalize discovery, as no GET_CAPABILITIES command will be issued.
--- audio/avdtp.c | 11 +++++++---- 1 files changed, 7 insertions(+), 4 deletions(-)
audio/avdtp.c +7 -4
@@ -2736,6 +2736,8 @@ static gboolean avdtp_discover_resp(struct avdtp *session, {int sep_count, i;uint8_t getcap_cmd; +int ret =0 ; +gboolean getcap_pending = FALSE;if (session->version >=0x0103 && session->server->version >=0x0103 ) getcap_cmd =AVDTP_GET_ALL_CAPABILITIES ;
@@ -2748,7 +2750,6 @@ static gboolean avdtp_discover_resp(struct avdtp *session,struct avdtp_remote_sep *sep;struct avdtp_stream *stream;struct seid_req req; -int ret; DBG("seid %d type %d media %d in use %d", resp->seps[i].seid, resp->seps[i].type,
@@ -2774,12 +2775,14 @@ static gboolean avdtp_discover_resp(struct avdtp *session, ret =send_request (session, TRUE,NULL , getcap_cmd, &req,sizeof (req)); -if (ret <0 ) { -finalize_discovery (session, -ret); +if (ret <0 )break ; - } + getcap_pending = TRUE; } +if (!getcap_pending) +finalize_discovery (session, -ret); +return TRUE; }
Signature · 1 line
1.7.4.1
Luiz Augusto von Dentz
maintainerHi Peter,
Quoted 35 lines · Peter Hurley
When handling the discover response, if all stream end points are in use, then we must finalize discovery, as no
GET_CAPABILITIEScommand will be issued.
---
audio/avdtp.c | 11 +++++++----1 files changed, 7 insertions(+), 4 deletions(-)audio/avdtp.c +3
-3@@ -2736,6 +2736,8 @@ static gboolean avdtp_discover_resp(struct avdtp *session, { int sep_count, i; uint8_t getcap_cmd; + int ret = 0; + gboolean getcap_pending = FALSE; if (session->version >= 0x0103 && session->server->version >= 0x0103) getcap_cmd = AVDTP_GET_ALL_CAPABILITIES;@@ -2748,7 +2750,6 @@ static gboolean avdtp_discover_resp(struct avdtp *session, struct avdtp_remote_sep *sep; struct avdtp_stream *stream; struct seid_req req; - int ret; DBG("seid %d type %d media %d in use %d", resp->seps[i].seid, resp->seps[i].type,@@ -2774,12 +2775,14 @@ static gboolean avdtp_discover_resp(struct avdtp *session, ret = send_request(session, TRUE, NULL, getcap_cmd, &req, sizeof(req)); - if (ret < 0) { - finalize_discovery(session, -ret); + if (ret < 0)
audio/avdtp.c static gboolean avdtp_discover_resp(struct avdtp *session, · line 2787
Quoted 10 lines
audio/avdtp.c +4
-1break; - } + getcap_pending = TRUE; } + if (!getcap_pending) + finalize_discovery(session, -ret); + return TRUE; }
Sounds like a bug to me not an improvement so I suggest you start your commit message with the word 'Fix ...', patch itself looks good though.
Signature · 1 line
Luiz Augusto von Dentz