From feb323b78756b80a3fa9cd540ba195388b0b6e18 Mon Sep 17 00:00:00 2001 From: The Android Open Source Project Date: Fri, 13 Mar 2009 13:04:20 -0700 Subject: [PATCH] auto import from //branches/cupcake_rel/...@138607 --- utils/audio/avdtp.c | 28 +++++++++++++++++++++++----- 1 file changed, 23 insertions(+), 5 deletions(-) diff --git a/utils/audio/avdtp.c b/utils/audio/avdtp.c index 02e269515..3a8060f68 100644 --- a/utils/audio/avdtp.c +++ b/utils/audio/avdtp.c @@ -2086,7 +2086,10 @@ static gboolean avdtp_set_configuration_resp(struct avdtp *session, struct avdtp_single_header *resp, int size) { - struct avdtp_local_sep *sep = stream->lsep; + struct avdtp_local_sep *sep; + if (!stream) + return TRUE; + sep = stream->lsep; if (sep->cfm && sep->cfm->set_configuration) sep->cfm->set_configuration(session, sep, stream, NULL, @@ -2116,7 +2119,10 @@ static gboolean avdtp_open_resp(struct avdtp *session, struct avdtp_stream *stre session->pending_open = stream; +/* Don't set state to AVDTP_STATE_OPEN yet. + Instead, wait until the pending_open completes in handle_transport_connect() avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN); +*/ return TRUE; } @@ -2125,7 +2131,10 @@ static gboolean avdtp_start_resp(struct avdtp *session, struct avdtp_stream *stream, struct seid_rej *resp, int size) { - struct avdtp_local_sep *sep = stream->lsep; + struct avdtp_local_sep *sep; + if (!stream) + return TRUE; + sep = stream->lsep; if (sep->cfm && sep->cfm->start) sep->cfm->start(session, sep, stream, NULL, sep->user_data); @@ -2139,7 +2148,10 @@ static gboolean avdtp_close_resp(struct avdtp *session, struct avdtp_stream *stream, struct seid_rej *resp, int size) { - struct avdtp_local_sep *sep = stream->lsep; + struct avdtp_local_sep *sep; + if (!stream) + return TRUE; + sep = stream->lsep; avdtp_sep_set_state(session, sep, AVDTP_STATE_CLOSING); @@ -2153,7 +2165,10 @@ static gboolean avdtp_suspend_resp(struct avdtp *session, struct avdtp_stream *stream, void *data, int size) { - struct avdtp_local_sep *sep = stream->lsep; + struct avdtp_local_sep *sep; + if (!stream) + return TRUE; + sep = stream->lsep; avdtp_sep_set_state(session, sep, AVDTP_STATE_OPEN); @@ -2172,7 +2187,10 @@ static gboolean avdtp_abort_resp(struct avdtp *session, struct avdtp_stream *stream, struct seid_rej *resp, int size) { - struct avdtp_local_sep *sep = stream->lsep; + struct avdtp_local_sep *sep; + if (!stream) + return TRUE; + sep = stream->lsep; if (sep->cfm && sep->cfm->abort) sep->cfm->abort(session, sep, stream, NULL, sep->user_data); -- 2.11.0