Fix SoundPool buffer size rounding error. Bug 2327620.
AudioTrack was modified earlier to calculate minimum buffer size based on the hardware reported latency. Previously, it was a hard-coded value. As a result of this change, the minimum buffer size is now variable based on hardware latency. On Passion, this brought out a subtle rounding error in the buffer size calculation in SoundPool. This can cause AudioTrack creation to fail based on the requested sample rate. This fix calculates the total buffer size first, and then does rounding before dividing by the number of buffers.
Loading
Please register or sign in to comment