summaryrefslogtreecommitdiffstats
path: root/services/audioflinger/AudioMixer.h
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-10-30 14:37:01 -0700
committerJean-Michel Trivi <jmtrivi@google.com>2013-11-06 18:05:09 +0000
commit49c34acbef91800930b0fe561e0787145a10cfcc (patch)
tree53e636df1a5868bbea112ec3bd36e19862208adf /services/audioflinger/AudioMixer.h
parentd21952fe5bc94f7bb6ee729f806c0e641fdb1a0d (diff)
downloadframeworks_av-49c34acbef91800930b0fe561e0787145a10cfcc.zip
frameworks_av-49c34acbef91800930b0fe561e0787145a10cfcc.tar.gz
frameworks_av-49c34acbef91800930b0fe561e0787145a10cfcc.tar.bz2
Fix race condition in initializing downmix
The code that initializes downmix GUID searches for an effect of the right type. If two or more AudioMixers are created, there is a possibility that the GUID will temporarily have the wrong value. Now the initialization is only done once, regardless of how many AudioMixers there are. Other minor changes: - use naming convention of leading 's' for static member variables - log message for no downmix effect is now a warning instead of an error, since it is not an error until there is actual content to downmix without a downmix effect Change-Id: I33ab0e51cf9d24ecaf8ae868883736b0772178c4
Diffstat (limited to 'services/audioflinger/AudioMixer.h')
-rw-r--r--services/audioflinger/AudioMixer.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/services/audioflinger/AudioMixer.h b/services/audioflinger/AudioMixer.h
index 43aeb86..a15bdca 100644
--- a/services/audioflinger/AudioMixer.h
+++ b/services/audioflinger/AudioMixer.h
@@ -256,9 +256,9 @@ private:
state_t mState __attribute__((aligned(32)));
// effect descriptor for the downmixer used by the mixer
- static effect_descriptor_t dwnmFxDesc;
+ static effect_descriptor_t sDwnmFxDesc;
// indicates whether a downmix effect has been found and is usable by this mixer
- static bool isMultichannelCapable;
+ static bool sIsMultichannelCapable;
// Call after changing either the enabled status of a track, or parameters of an enabled track.
// OK to call more often than that, but unnecessary.