summaryrefslogtreecommitdiff
path: root/android/hal-audio.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-02-10 11:45:42 +0100
committerLuiz Augusto von Dentz <luiz.von.dentz@intel.com>2014-02-10 13:22:57 +0200
commit3290badf07006a3b6fcf4489d5585c90a98721b2 (patch)
treece945080abb1c48b4a3572eea7b486e259dec91b /android/hal-audio.c
parent217b2102f17d3920ea2e6561ee025629aa8011a6 (diff)
downloadbluez-3290badf07006a3b6fcf4489d5585c90a98721b2.tar.gz
android/hal-audio: Ignore write call when closing
We should not try to neither auto-resume nor write when state is set to NONE as this is case when we're being closed and it's ok do ignore write request.
Diffstat (limited to 'android/hal-audio.c')
-rw-r--r--android/hal-audio.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/android/hal-audio.c b/android/hal-audio.c
index efdf823ee..766327be7 100644
--- a/android/hal-audio.c
+++ b/android/hal-audio.c
@@ -831,6 +831,10 @@ static ssize_t out_write(struct audio_stream_out *stream, const void *buffer,
{
struct a2dp_stream_out *out = (struct a2dp_stream_out *) stream;
+ /* just return in case we're closing */
+ if (out->audio_state == AUDIO_A2DP_STATE_NONE)
+ return -1;
+
/* We can auto-start only from standby */
if (out->audio_state == AUDIO_A2DP_STATE_STANDBY) {
DBG("stream in standby, auto-start");