diff options
author | Eric Laurent <elaurent@google.com> | 2012-03-05 17:04:20 -0800 |
---|---|---|
committer | Eric Laurent <elaurent@google.com> | 2012-03-05 17:04:20 -0800 |
commit | 62215e25c389f985f713ffa31dd74b76d31a38c3 (patch) | |
tree | cf30deb1245c18949f2cc65028c1c2054fc03e2c | |
parent | f78869fbc9c8df7bd07e9ae294ef2d71960dcd9e (diff) | |
download | bluez-62215e25c389f985f713ffa31dd74b76d31a38c3.tar.gz |
audio: fix wrong latency reported by audio HAL
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.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/audio/android_audio_hw.c b/audio/android_audio_hw.c index d6a33470..e8a3df61 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, |