FP2-1887: bluetooth: a2dp: Buffer sufficient data to keep devices happy

bluetooth: a2dp: Buffer sufficient data to keep devices happy

This commit changes the computation for the buffer size to be
based on the actual number of ms that we want to buffer and
it (now) correctly buffers the right amount.

When playing audio I am seeing a frame size of 512 bytes which
means that the previous computation of 18 frames * 512 bytes
is only 4K of buffered data.  That is roughly 1.1 ticks worth
of data as each tick if 3528 bytes.

Instead, to buffer 360ms of data we want 18 *ticks* and not
18 frames and the new computation will provide that by dynamically
computing the number of pcm bytes it takes to fill a tick.

Change-Id: I4c9eaafe5b5aa7a7984ca00ffa78ce1206dc8a67
1 file changed