summaryrefslogtreecommitdiffstats
path: root/media/libeffects
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-08-31 15:46:41 -0700
committerAndroid Git Automerger <android-git-automerger@android.com>2010-08-31 15:46:41 -0700
commit2e0448f9be36784d07581d1c2ef7a0c0ecba0663 (patch)
treee5bde23e2d94c9a57adf9c1e6681f74cd3e9ee66 /media/libeffects
parentdc344e56790d2a301d25c27a4c0ae47cdac2898b (diff)
parent8f45bd725549436eeacd12ee69349e2332ed8da5 (diff)
downloadframeworks_av-2e0448f9be36784d07581d1c2ef7a0c0ecba0663.zip
frameworks_av-2e0448f9be36784d07581d1c2ef7a0c0ecba0663.tar.gz
frameworks_av-2e0448f9be36784d07581d1c2ef7a0c0ecba0663.tar.bz2
am f560ceab: Merge "Audio Effects: fix problems in volume control." into gingerbread
Merge commit 'f560ceabe11b4f541c568bead61a5ec8f527151c' into gingerbread-plus-aosp * commit 'f560ceabe11b4f541c568bead61a5ec8f527151c': Audio Effects: fix problems in volume control.
Diffstat (limited to 'media/libeffects')
-rw-r--r--media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp30
1 files changed, 22 insertions, 8 deletions
diff --git a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
index d3bb96e..7297811 100644
--- a/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
+++ b/media/libeffects/lvm/wrapper/Bundle/EffectBundle.cpp
@@ -258,16 +258,24 @@ extern "C" int EffectCreate(effect_uuid_t *uuid,
pContext->pBundledContext->firstVolume = LVM_TRUE;
#ifdef LVM_PCM
- pContext->pBundledContext->PcmInPtr = NULL;
- pContext->pBundledContext->PcmOutPtr = NULL;
- pContext->pBundledContext->PcmInPtr = fopen("/data/tmp/bundle_pcm_in.pcm", "w");
- pContext->pBundledContext->PcmOutPtr = fopen("/data/tmp/bundle_pcm_out.pcm", "w");
+ char fileName[256];
+ snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_in.pcm", pContext->pBundledContext);
+ pContext->pBundledContext->PcmInPtr = fopen(fileName, "w");
+ if (pContext->pBundledContext->PcmInPtr == NULL) {
+ LOGV("cannot open %s", fileName);
+ return -EINVAL;
+ }
- if((pContext->pBundledContext->PcmInPtr == NULL)||
- (pContext->pBundledContext->PcmOutPtr == NULL)){
+ snprintf(fileName, 256, "/data/tmp/bundle_%p_pcm_out.pcm", pContext->pBundledContext);
+ pContext->pBundledContext->PcmOutPtr = fopen(fileName, "w");
+ if (pContext->pBundledContext->PcmOutPtr == NULL) {
+ LOGV("cannot open %s", fileName);
+ fclose(pContext->pBundledContext->PcmInPtr);
+ pContext->pBundledContext->PcmInPtr = NULL;
return -EINVAL;
}
+
#endif
/* Saved strength is used to return the exact strength that was used in the set to the get
@@ -375,8 +383,14 @@ extern "C" int EffectRelease(effect_interface_t interface){
(GlobalSessionMemory[pContext->pBundledContext->SessionNo].bVirtualizerInstantiated==LVM_FALSE))
{
#ifdef LVM_PCM
- fclose(pContext->pBundledContext->PcmInPtr);
- fclose(pContext->pBundledContext->PcmOutPtr);
+ if (pContext->pBundledContext->PcmInPtr != NULL) {
+ fclose(pContext->pBundledContext->PcmInPtr);
+ pContext->pBundledContext->PcmInPtr = NULL;
+ }
+ if (pContext->pBundledContext->PcmOutPtr != NULL) {
+ fclose(pContext->pBundledContext->PcmOutPtr);
+ pContext->pBundledContext->PcmOutPtr = NULL;
+ }
#endif
LvmSessionsActive--;