aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2012-03-05 17:04:20 -0800
committerEric Laurent <elaurent@google.com>2012-03-16 12:19:24 -0700
commit11db147d66fb1339054414318d13f090d6905e77 (patch)
treeddcaa3835140774540d02cc0099c4d131c6f83cf
parent05675015d13729f7da5bf32c88264c68e02d6028 (diff)
downloadbluez-11db147d66fb1339054414318d13f090d6905e77.tar.gz
audio: fix wrong latency reported by audio HALics-mr1
Commit 355afe9a broke the calculation of the latency returned by A2DP, leading to incorrect A/V sync. The latency must take into account the intermediate buffering added in audio HAL. Change-Id: I1f3d7494fe58517151c5dba0a4883f583d7a6ef2
-rw-r--r--audio/android_audio_hw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/android_audio_hw.c b/audio/android_audio_hw.c
index e552f7a7..348ad14d 100644
--- a/audio/android_audio_hw.c
+++ b/audio/android_audio_hw.c
@@ -180,7 +180,7 @@ static uint32_t out_get_latency(const struct audio_stream_out *stream)
{
const struct astream_out *out = (const struct astream_out *)stream;
- return (out->buffer_duration_us / 1000) + 200;
+ return ((out->buffer_duration_us * BUF_NUM_PERIODS) / 1000) + 200;
}
static int out_set_volume(struct audio_stream_out *stream, float left,