mirror of
https://github.com/Evolution-X/hardware_interfaces
synced 2026-02-01 16:50:18 +00:00
Merge "audio: Adjust stream buffer size calculation" into main am: 222d034461 am: a5855a1592
Original change: https://android-review.googlesource.com/c/platform/hardware/interfaces/+/3008508 Change-Id: I8484832349e3af69cec9ca2a56f315f225b83427 Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
@@ -213,7 +213,7 @@ class Module : public BnModule {
|
||||
sampleRateHz);
|
||||
// Round up to nearest 16 frames since in the framework this is the size of a mixer burst.
|
||||
const int32_t multipleOf16 = (rawSizeFrames + 15) & ~15;
|
||||
if (multipleOf16 <= 512) return multipleOf16;
|
||||
if (sampleRateHz < 44100 || multipleOf16 <= 512) return multipleOf16;
|
||||
// Larger buffers should use powers of 2.
|
||||
int32_t powerOf2 = 1;
|
||||
while (powerOf2 < multipleOf16) powerOf2 <<= 1;
|
||||
|
||||
Reference in New Issue
Block a user