From 20569262fce8b047bfc253d91ccb0f455863fde1 Mon Sep 17 00:00:00 2001 From: Jean-Michel Trivi Date: Fri, 19 Jun 2015 12:26:52 -0700 Subject: 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 --- media/libeffects/factory/EffectsFactory.c | 16 ++++++++++++---- media/libeffects/factory/EffectsFactory.h | 1 + 2 files changed, 13 insertions(+), 4 deletions(-) (limited to 'media/libeffects') 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 #include +#include #include 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; -- cgit v1.1