summaryrefslogtreecommitdiff
path: root/android/a2dp.c
diff options
context:
space:
mode:
authorAndrzej Kaczmarek <andrzej.kaczmarek@tieto.com>2014-01-23 17:59:52 +0100
committerSzymon Janc <szymon.janc@gmail.com>2014-01-24 22:59:45 +0100
commit77ff405a45e5be8d87f8da544f03a5454b967128 (patch)
tree53db23afecf70ff3c880937afba38ece8ca6e0ea /android/a2dp.c
parentca90266d4f16a3624b1cbadd1d5623fe5fcee5a2 (diff)
downloadbluez-77ff405a45e5be8d87f8da544f03a5454b967128.tar.gz
android/a2dp: Fix audio resume on started stream
In case stream is started from remote we'll receive Resume Stream IPC when audio is already considered as started (i.e. on first write from AudioFlinger). In such case we should not try to send AVDTP_START since this will fail but just reply success over IPC instead.
Diffstat (limited to 'android/a2dp.c')
-rw-r--r--android/a2dp.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/android/a2dp.c b/android/a2dp.c
index 0326b1953..319162588 100644
--- a/android/a2dp.c
+++ b/android/a2dp.c
@@ -1377,10 +1377,12 @@ static void bt_stream_resume(const void *buf, uint16_t len)
goto failed;
}
- err = avdtp_start(setup->dev->session, setup->stream);
- if (err < 0) {
- error("avdtp_start: %s", strerror(-err));
- goto failed;
+ if (setup->state != HAL_AUDIO_STARTED) {
+ err = avdtp_start(setup->dev->session, setup->stream);
+ if (err < 0) {
+ error("avdtp_start: %s", strerror(-err));
+ goto failed;
+ }
}
audio_ipc_send_rsp(AUDIO_OP_RESUME_STREAM, AUDIO_STATUS_SUCCESS);