summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioResamplerCubic.cpp
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-08-13 09:14:51 -0700
committerGlenn Kasten <gkasten@google.com>2013-08-13 09:55:59 -0700
commit6e2ebe97f2ad0a21907f20f9ee644c4eacbb7a40 (patch)
treeea9d525f25620253ea86f434452bc37fbad73f76 /services/audioflinger/AudioResamplerCubic.cpp
parente198c360d5e75a9b2097844c495c10902e7e8500 (diff)
downloadframeworks_av-6e2ebe97f2ad0a21907f20f9ee644c4eacbb7a40.zip
frameworks_av-6e2ebe97f2ad0a21907f20f9ee644c4eacbb7a40.tar.gz
frameworks_av-6e2ebe97f2ad0a21907f20f9ee644c4eacbb7a40.tar.bz2
Use curly braces in 'if' to make it easier to add logs
Change-Id: I58b33fefdd8bf703647414157a99a3223be3531c
Diffstat (limited to 'services/audioflinger/AudioResamplerCubic.cpp')
-rw-r--r--services/audioflinger/AudioResamplerCubic.cpp12
1 files changed, 8 insertions, 4 deletions
diff --git a/services/audioflinger/AudioResamplerCubic.cpp b/services/audioflinger/AudioResamplerCubic.cpp
index 18e59e9..1f9714b 100644
--- a/services/audioflinger/AudioResamplerCubic.cpp
+++ b/services/audioflinger/AudioResamplerCubic.cpp
@@ -66,8 +66,9 @@ void AudioResamplerCubic::resampleStereo16(int32_t* out, size_t outFrameCount,
if (mBuffer.frameCount == 0) {
mBuffer.frameCount = inFrameCount;
provider->getNextBuffer(&mBuffer, mPTS);
- if (mBuffer.raw == NULL)
+ if (mBuffer.raw == NULL) {
return;
+ }
// ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
}
int16_t *in = mBuffer.i16;
@@ -97,8 +98,9 @@ void AudioResamplerCubic::resampleStereo16(int32_t* out, size_t outFrameCount,
mBuffer.frameCount = inFrameCount;
provider->getNextBuffer(&mBuffer,
calculateOutputPTS(outputIndex / 2));
- if (mBuffer.raw == NULL)
+ if (mBuffer.raw == NULL) {
goto save_state; // ugly, but efficient
+ }
in = mBuffer.i16;
// ALOGW("New buffer: offset=%p, frames=%d", mBuffer.raw, mBuffer.frameCount);
}
@@ -132,8 +134,9 @@ void AudioResamplerCubic::resampleMono16(int32_t* out, size_t outFrameCount,
if (mBuffer.frameCount == 0) {
mBuffer.frameCount = inFrameCount;
provider->getNextBuffer(&mBuffer, mPTS);
- if (mBuffer.raw == NULL)
+ if (mBuffer.raw == NULL) {
return;
+ }
// ALOGW("New buffer: offset=%p, frames=%d", mBuffer.raw, mBuffer.frameCount);
}
int16_t *in = mBuffer.i16;
@@ -163,8 +166,9 @@ void AudioResamplerCubic::resampleMono16(int32_t* out, size_t outFrameCount,
mBuffer.frameCount = inFrameCount;
provider->getNextBuffer(&mBuffer,
calculateOutputPTS(outputIndex / 2));
- if (mBuffer.raw == NULL)
+ if (mBuffer.raw == NULL) {
goto save_state; // ugly, but efficient
+ }
// ALOGW("New buffer: offset=%p, frames=%dn", mBuffer.raw, mBuffer.frameCount);
in = mBuffer.i16;
}