aaudio: fix callback size for Legacy input
Set the size of the callback buffer based on the device format
instead of the app format.
Bug: 149249791
Test: atest CtsNativeMediaAAudioTestCases
Change-Id: I0dc5724109a802eea15100782c18986a64e6acd2
diff --git a/media/libaaudio/src/legacy/AudioStreamLegacy.cpp b/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
index 91d2eff..abc3239 100644
--- a/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
+++ b/media/libaaudio/src/legacy/AudioStreamLegacy.cpp
@@ -72,7 +72,7 @@
// Implement FixedBlockProcessor
int32_t AudioStreamLegacy::onProcessFixedBlock(uint8_t *buffer, int32_t numBytes) {
- int32_t numFrames = numBytes / getBytesPerDeviceFrame();
+ int32_t numFrames = numBytes / mBlockAdapterBytesPerFrame;
return (int32_t) callDataCallbackFrames(buffer, numFrames);
}