Loading services/audioflinger/Effects.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,8 @@ #define ALOGVV(a...) do { } while(0) #define ALOGVV(a...) do { } while(0) #endif #endif #define min(a, b) ((a) < (b) ? (a) : (b)) namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -1391,7 +1393,8 @@ void AudioFlinger::EffectChain::clearInputBuffer_l(sp<ThreadBase> thread) // and sample format changes for effects. // and sample format changes for effects. // Currently effects processing is only available for stereo, AUDIO_FORMAT_PCM_16_BIT // Currently effects processing is only available for stereo, AUDIO_FORMAT_PCM_16_BIT // (4 bytes frame size) // (4 bytes frame size) const size_t frameSize = audio_bytes_per_sample(AUDIO_FORMAT_PCM_16_BIT) * FCC_2; const size_t frameSize = audio_bytes_per_sample(AUDIO_FORMAT_PCM_16_BIT) * min(FCC_2, thread->channelCount()); memset(mInBuffer, 0, thread->frameCount() * frameSize); memset(mInBuffer, 0, thread->frameCount() * frameSize); } } Loading Loading
services/audioflinger/Effects.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -44,6 +44,8 @@ #define ALOGVV(a...) do { } while(0) #define ALOGVV(a...) do { } while(0) #endif #endif #define min(a, b) ((a) < (b) ? (a) : (b)) namespace android { namespace android { // ---------------------------------------------------------------------------- // ---------------------------------------------------------------------------- Loading Loading @@ -1391,7 +1393,8 @@ void AudioFlinger::EffectChain::clearInputBuffer_l(sp<ThreadBase> thread) // and sample format changes for effects. // and sample format changes for effects. // Currently effects processing is only available for stereo, AUDIO_FORMAT_PCM_16_BIT // Currently effects processing is only available for stereo, AUDIO_FORMAT_PCM_16_BIT // (4 bytes frame size) // (4 bytes frame size) const size_t frameSize = audio_bytes_per_sample(AUDIO_FORMAT_PCM_16_BIT) * FCC_2; const size_t frameSize = audio_bytes_per_sample(AUDIO_FORMAT_PCM_16_BIT) * min(FCC_2, thread->channelCount()); memset(mInBuffer, 0, thread->frameCount() * frameSize); memset(mInBuffer, 0, thread->frameCount() * frameSize); } } Loading