From: Luiz Augusto von Dentz <luiz.dentz@gmail.com>
To: linux-bluetooth@vger.kernel.org
Subject: [PATCH 2/5] Fix handling of a2dp suspend indication
Date: Wed, 6 Apr 2011 14:00:34 +0300 [thread overview]
Message-ID: <1302087637-30131-3-git-send-email-luiz.dentz@gmail.com> (raw)
In-Reply-To: <1302087637-30131-1-git-send-email-luiz.dentz@gmail.com>
From: Luiz Augusto von Dentz <luiz.dentz-von@nokia.com>
When accepting the suspend indication all callbacks should be notified
that suspend completed.
---
audio/a2dp.c | 26 ++++++++++++++++++++++++++
1 files changed, 26 insertions(+), 0 deletions(-)
diff --git a/audio/a2dp.c b/audio/a2dp.c
index 1f3bc99..c7b6c6a 100644
--- a/audio/a2dp.c
+++ b/audio/a2dp.c
@@ -986,6 +986,9 @@ static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep,
void *user_data)
{
struct a2dp_sep *a2dp_sep = user_data;
+ struct a2dp_setup *setup;
+ gboolean start;
+ int perr;
if (a2dp_sep->type == AVDTP_SEP_TYPE_SINK)
DBG("Sink %p: Suspend_Ind", sep);
@@ -999,6 +1002,29 @@ static gboolean suspend_ind(struct avdtp *session, struct avdtp_local_sep *sep,
a2dp_sep->session = NULL;
}
+ if (!a2dp_sep->suspending)
+ return TRUE;
+
+ a2dp_sep->suspending = FALSE;
+
+ setup = find_setup_by_session(session);
+ if (!setup)
+ return TRUE;
+
+ start = setup->start;
+ setup->start = FALSE;
+
+ finalize_suspend(setup);
+
+ if (!start)
+ return TRUE;
+
+ perr = avdtp_start(session, a2dp_sep->stream);
+ if (perr < 0) {
+ error("Error on avdtp_start %s (%d)", strerror(-perr), -perr);
+ finalize_setup_errno(setup, -EIO, finalize_resume);
+ }
+
return TRUE;
}
--
1.7.1
next prev parent reply other threads:[~2011-04-06 11:00 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-06 11:00 [PATCH 0/5] [RFC] handling avdtp collisions Luiz Augusto von Dentz
2011-04-06 11:00 ` [PATCH 1/5] Add handling of avdtp command collision Luiz Augusto von Dentz
2011-04-06 11:00 ` Luiz Augusto von Dentz [this message]
2011-04-06 11:00 ` [PATCH 3/5] Fix handling of a2dp open indication Luiz Augusto von Dentz
2011-04-06 11:00 ` [PATCH 4/5] Fix handling of a2dp start indication Luiz Augusto von Dentz
2011-04-06 11:00 ` [PATCH 5/5] Fix handling of a2dp abort indication Luiz Augusto von Dentz
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1302087637-30131-3-git-send-email-luiz.dentz@gmail.com \
--to=luiz.dentz@gmail.com \
--cc=linux-bluetooth@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox