summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Laurent <elaurent@google.com>2010-11-18 08:40:16 -0800
committerEric Laurent <elaurent@google.com>2010-11-19 15:49:42 -0800
commitf5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0 (patch)
tree75b6429a6bb8b78943b770cad6924a7aaa94dc32 /include
parentb9ff444a7eaf7ffd43970c0477110c6808bd4a7c (diff)
downloadframeworks_av-f5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0.zip
frameworks_av-f5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0.tar.gz
frameworks_av-f5aafb209d01ba2ab6cb55d1a12cfc653e2b4be0.tar.bz2
Fix issue 3157123.
Use a Mutex wherever atomic operations were used in AudioTrack, AudioRecord, AudioFlinger and AudioEffect classes. Change-Id: I6f55b2cabdcd93d64ef19446735b8f33720f8dbc
Diffstat (limited to 'include')
-rw-r--r--include/media/AudioEffect.h3
-rw-r--r--include/media/AudioRecord.h2
-rw-r--r--include/media/AudioTrack.h1
3 files changed, 4 insertions, 2 deletions
diff --git a/include/media/AudioEffect.h b/include/media/AudioEffect.h
index c967efb..cda2be0 100644
--- a/include/media/AudioEffect.h
+++ b/include/media/AudioEffect.h
@@ -403,7 +403,7 @@ public:
static status_t guidToString(const effect_uuid_t *guid, char *str, size_t maxLen);
protected:
- volatile int32_t mEnabled; // enable state
+ bool mEnabled; // enable state
int32_t mSessionId; // audio session ID
int32_t mPriority; // priority for effect control
status_t mStatus; // effect status
@@ -412,6 +412,7 @@ protected:
void* mUserData; // client context for callback function
effect_descriptor_t mDescriptor; // effect descriptor
int32_t mId; // system wide unique effect engine instance ID
+ Mutex mLock; // Mutex for mEnabled access
private:
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index 38e3d44..5f7cd90 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -356,7 +356,7 @@ private:
sp<IAudioRecord> mAudioRecord;
sp<IMemory> mCblkMemory;
sp<ClientRecordThread> mClientRecordThread;
- Mutex mRecordThreadLock;
+ Mutex mLock;
uint32_t mFrameCount;
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 4475d4a..813a905 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -480,6 +480,7 @@ private:
uint32_t mFlags;
int mSessionId;
int mAuxEffectId;
+ Mutex mLock;
};