diff options
author | Eric Laurent <elaurent@google.com> | 2014-11-10 23:33:52 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-11-10 23:33:52 +0000 |
commit | 8db769dd56822a59f1997a9cb53ed02d3d1cb8dd (patch) | |
tree | 53004025edb4efe9ce26578a381ace9c78200592 /media | |
parent | 58dc8c42f2880b4264bfad46b9ab443576d4b4f2 (diff) | |
parent | df878bd3fc63f26e91b055e39ba63c53c14b31a0 (diff) | |
download | frameworks_base-8db769dd56822a59f1997a9cb53ed02d3d1cb8dd.zip frameworks_base-8db769dd56822a59f1997a9cb53ed02d3d1cb8dd.tar.gz frameworks_base-8db769dd56822a59f1997a9cb53ed02d3d1cb8dd.tar.bz2 |
am df878bd3: am ced2f74a: am e8c1a97f: am 3b92fc04: am 1c2b0d52: AudioEffect JNI: use new max preprocessing constant
* commit 'df878bd3fc63f26e91b055e39ba63c53c14b31a0':
AudioEffect JNI: use new max preprocessing constant
Diffstat (limited to 'media')
-rw-r--r-- | media/jni/audioeffect/android_media_AudioEffect.cpp | 20 |
1 files changed, 2 insertions, 18 deletions
diff --git a/media/jni/audioeffect/android_media_AudioEffect.cpp b/media/jni/audioeffect/android_media_AudioEffect.cpp index be37aa8..3cd6341 100644 --- a/media/jni/audioeffect/android_media_AudioEffect.cpp +++ b/media/jni/audioeffect/android_media_AudioEffect.cpp @@ -789,28 +789,12 @@ queryEffects_failure: static jobjectArray android_media_AudioEffect_native_queryPreProcessings(JNIEnv *env, jclass clazz, jint audioSession) { - // kDefaultNumEffects is a "reasonable" value ensuring that only one query will be enough on - // most devices to get all active audio pre processing on a given session. - static const uint32_t kDefaultNumEffects = 5; - - effect_descriptor_t *descriptors = new effect_descriptor_t[kDefaultNumEffects]; - uint32_t numEffects = kDefaultNumEffects; + effect_descriptor_t *descriptors = new effect_descriptor_t[AudioEffect::kMaxPreProcessing]; + uint32_t numEffects = AudioEffect::kMaxPreProcessing; status_t status = AudioEffect::queryDefaultPreProcessing(audioSession, descriptors, &numEffects); - if ((status != NO_ERROR && status != NO_MEMORY) || - numEffects == 0) { - delete[] descriptors; - return NULL; - } - if (status == NO_MEMORY) { - delete [] descriptors; - descriptors = new effect_descriptor_t[numEffects]; - status = AudioEffect::queryDefaultPreProcessing(audioSession, - descriptors, - &numEffects); - } if (status != NO_ERROR || numEffects == 0) { delete[] descriptors; return NULL; |