summaryrefslogtreecommitdiffstats
path: root/services
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-09-02 11:56:55 -0700
committerEric Laurent <elaurent@google.com>2010-09-02 11:56:55 -0700
commitaeae3de947fa0b1e670c8472b32288962f97b4f5 (patch)
treeb90cc3f792c8c4151b32e002181e1b036d4495ba /services
parent8f45bd725549436eeacd12ee69349e2332ed8da5 (diff)
downloadframeworks_av-aeae3de947fa0b1e670c8472b32288962f97b4f5.zip
frameworks_av-aeae3de947fa0b1e670c8472b32288962f97b4f5.tar.gz
frameworks_av-aeae3de947fa0b1e670c8472b32288962f97b4f5.tar.bz2
Fix problem in AudioEffect::command() status.
The *pReplyData argument of the command() function was left unitialized by EffectHandle::command() when command was EFFECT_CMD_ENABLE, EFFECT_CMD_DISABLE and EFFECT_CMD_SET_PARAM_COMMIT. Change-Id: I91a19817ead2a8cfbdd8e2d77ca270c7ce9d5bd4
Diffstat (limited to 'services')
-rw-r--r--services/audioflinger/AudioFlinger.cpp14
1 files changed, 9 insertions, 5 deletions
diff --git a/services/audioflinger/AudioFlinger.cpp b/services/audioflinger/AudioFlinger.cpp
index 1acdaaf..3770b55 100644
--- a/services/audioflinger/AudioFlinger.cpp
+++ b/services/audioflinger/AudioFlinger.cpp
@@ -5992,12 +5992,14 @@ status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
p,
&rsize,
&reply);
- if (ret == NO_ERROR) {
- if (reply != NO_ERROR) {
- status = reply;
- }
- } else {
+ // stop at first error encountered
+ if (ret != NO_ERROR) {
status = ret;
+ *(int *)pReplyData = reply;
+ break;
+ } else if (reply != NO_ERROR) {
+ *(int *)pReplyData = reply;
+ break;
}
mCblk->serverIndex += size;
}
@@ -6005,8 +6007,10 @@ status_t AudioFlinger::EffectHandle::command(uint32_t cmdCode,
mCblk->clientIndex = 0;
return status;
} else if (cmdCode == EFFECT_CMD_ENABLE) {
+ *(int *)pReplyData = NO_ERROR;
return enable();
} else if (cmdCode == EFFECT_CMD_DISABLE) {
+ *(int *)pReplyData = NO_ERROR;
return disable();
}