diff options
author | Yu Kang Ku <kang.ku@motorola.com> | 2009-11-05 10:49:48 -0800 |
---|---|---|
committer | Nick Pelly <npelly@google.com> | 2009-11-05 10:49:48 -0800 |
commit | a74a11ed158d466e89c27961fe67934979104c38 (patch) | |
tree | 2f32704ba0b6470b980f8e150e00804334263e0f | |
parent | 60a51ae85f9e049d3522e118de1d4518b543e1ff (diff) | |
download | bluez-eclair-sholes-release.tar.gz |
Send SBC frames if output buffer is nearly full.android-sdk-2.0.1_r1android-sdk-2.0.1-docs_r1android-2.0.1_r1eclair-sholes-release
This is to address an A2DP issue seen with the Mazda carkit, where A2DP audio
cannot be played. The MTU size (8200) requested by this carkit is much greater
than the output buffer size (2048) allocated by the Bluez A2DP profile. The
output buffer being full is giving an SBC encode error. This patch checks for
the buffer full condition.
Change-Id: Idded504d085c760baef15cd3cef84fcf57165e4f
Signed-off-by: Yu Kang Ku <kang.ku@motorola.com>
Signed-off-by: Nick Pelly <npelly@google.com>
-rwxr-xr-x | audio/liba2dp.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/audio/liba2dp.c b/audio/liba2dp.c index 7dcfc9dc..74038866 100755 --- a/audio/liba2dp.c +++ b/audio/liba2dp.c @@ -1160,7 +1160,8 @@ int a2dp_write(a2dpData d, const void* buffer, int count) data->nsamples += encoded; /* No space left for another frame then send */ - if (data->count + written >= data->link_mtu) { + if ((data->count + written >= data->link_mtu) || + (data->count + written >= BUFFER_SIZE)) { VDBG("sending packet %d, count %d, link_mtu %u", data->seq_num, data->count, data->link_mtu); |