summaryrefslogtreecommitdiffstats
path: root/media
diff options
context:
space:
mode:
authorJean-Michel Trivi <jmtrivi@google.com>2015-06-19 12:26:52 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2015-06-22 09:26:16 -0700
commit20569262fce8b047bfc253d91ccb0f455863fde1 (patch)
treeb775e9090619570eed1e74692b1190a6f68f6d65 /media
parent47b1ca9cf7c45564887832bfdec21ccc18eb448e (diff)
downloadframeworks_av-20569262fce8b047bfc253d91ccb0f455863fde1.zip
frameworks_av-20569262fce8b047bfc253d91ccb0f455863fde1.tar.gz
frameworks_av-20569262fce8b047bfc253d91ccb0f455863fde1.tar.bz2
Add property to ignore audio effects on the platform
Use boolean property ro.audio.ignore_effects to load or ignore the audio effects. Bug 21906334 Change-Id: I778f8b10a1caf25f7679705b1c83775223df011d
Diffstat (limited to 'media')
-rw-r--r--media/libeffects/factory/EffectsFactory.c16
-rw-r--r--media/libeffects/factory/EffectsFactory.h1
2 files changed, 13 insertions, 4 deletions
diff --git a/media/libeffects/factory/EffectsFactory.c b/media/libeffects/factory/EffectsFactory.c
index c310fe2..db7865a 100644
--- a/media/libeffects/factory/EffectsFactory.c
+++ b/media/libeffects/factory/EffectsFactory.c
@@ -24,6 +24,7 @@
#include <cutils/misc.h>
#include <cutils/config_utils.h>
+#include <cutils/properties.h>
#include <audio_effects/audio_effects_conf.h>
static list_elem_t *gEffectList; // list of effect_entry_t: all currently created effects
@@ -447,12 +448,19 @@ int init() {
return 0;
}
+ // ignore effects or not?
+ const bool ignoreFxConfFiles = property_get_bool(PROPERTY_IGNORE_EFFECTS, false);
+
pthread_mutex_init(&gLibLock, NULL);
- if (access(AUDIO_EFFECT_VENDOR_CONFIG_FILE, R_OK) == 0) {
- loadEffectConfigFile(AUDIO_EFFECT_VENDOR_CONFIG_FILE);
- } else if (access(AUDIO_EFFECT_DEFAULT_CONFIG_FILE, R_OK) == 0) {
- loadEffectConfigFile(AUDIO_EFFECT_DEFAULT_CONFIG_FILE);
+ if (ignoreFxConfFiles) {
+ ALOGI("Audio effects in configuration files will be ignored");
+ } else {
+ if (access(AUDIO_EFFECT_VENDOR_CONFIG_FILE, R_OK) == 0) {
+ loadEffectConfigFile(AUDIO_EFFECT_VENDOR_CONFIG_FILE);
+ } else if (access(AUDIO_EFFECT_DEFAULT_CONFIG_FILE, R_OK) == 0) {
+ loadEffectConfigFile(AUDIO_EFFECT_DEFAULT_CONFIG_FILE);
+ }
}
updateNumEffects();
diff --git a/media/libeffects/factory/EffectsFactory.h b/media/libeffects/factory/EffectsFactory.h
index 560b485..518800d 100644
--- a/media/libeffects/factory/EffectsFactory.h
+++ b/media/libeffects/factory/EffectsFactory.h
@@ -26,6 +26,7 @@
extern "C" {
#endif
+#define PROPERTY_IGNORE_EFFECTS "ro.audio.ignore_effects"
typedef struct list_elem_s {
void *object;