From 3290badf07006a3b6fcf4489d5585c90a98721b2 Mon Sep 17 00:00:00 2001 From: Andrzej Kaczmarek Date: Mon, 10 Feb 2014 11:45:42 +0100 Subject: [PATCH] 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. --- android/hal-audio.c | 4 ++++ 1 file changed, 4 insertions(+) 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"); -- 2.47.3