summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
Diffstat (limited to 'audio/multizone')
-rw-r--r--audio/multizone/AudioHw.cpp10
1 files changed, 4 insertions, 6 deletions
diff --git a/audio/multizone/AudioHw.cpp b/audio/multizone/AudioHw.cpp
index f25bb43..a532abd 100644
--- a/audio/multizone/AudioHw.cpp
+++ b/audio/multizone/AudioHw.cpp
@@ -393,10 +393,9 @@ size_t AudioStreamIn::getBufferSize() const
393{ 393{
394 size_t size; 394 size_t size;
395 395
396 /* Take resampling ratio into account and align to the nearest 396 /* Take resampling ratio into account */
397 * 16 frames as required by the AudioFlinger */
398 size = (mParams.frameCount * mParams.sampleRate) / mReader->getParams().sampleRate; 397 size = (mParams.frameCount * mParams.sampleRate) / mReader->getParams().sampleRate;
399 size = ((size + 15) & ~15) * mParams.frameSize(); 398 size = size * mParams.frameSize();
400 399
401 ALOGVV("AudioStreamIn: getBufferSize() %u bytes", size); 400 ALOGVV("AudioStreamIn: getBufferSize() %u bytes", size);
402 401
@@ -1032,14 +1031,13 @@ size_t AudioHwDevice::getInputBufferSize(const struct audio_config *config) cons
1032 AutoMutex lock(mLock); 1031 AutoMutex lock(mLock);
1033 size_t size; 1032 size_t size;
1034 1033
1035 /* Take resampling ratio into account and align to the nearest 1034 /* Take resampling ratio into account */
1036 * 16 frames as required by the AudioFlinger */
1037 /* Use port 0 for the calculation, since values for both ports are the same */ 1035 /* Use port 0 for the calculation, since values for both ports are the same */
1038 uint32_t frames = mReaders[kCPUPortId]->getParams().frameCount; 1036 uint32_t frames = mReaders[kCPUPortId]->getParams().frameCount;
1039 uint32_t rate = mReaders[kCPUPortId]->getParams().sampleRate; 1037 uint32_t rate = mReaders[kCPUPortId]->getParams().sampleRate;
1040 1038
1041 size = (frames * config->sample_rate) / rate; 1039 size = (frames * config->sample_rate) / rate;
1042 size = ((size + 15) & ~15) * mReaders[kCPUPortId]->getParams().frameSize(); 1040 size = size * mReaders[kCPUPortId]->getParams().frameSize();
1043 1041
1044 ALOGV("AudioHwDevice: getInputBufferSize() %d bytes", size); 1042 ALOGV("AudioHwDevice: getInputBufferSize() %d bytes", size);
1045 1043