Rename control block flags to mFlags

Change-Id: I7b6d31e24531954ab1ecdf3ed56c19433700bd89
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index 603c16e..0e7e17f 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -300,7 +300,7 @@
     mProxy->setEpoch(mProxy->getEpoch() - mProxy->getPosition());
 
     mNewPosition = mProxy->getPosition() + mUpdatePeriod;
-    int32_t flags = android_atomic_acquire_load(&mCblk->flags);
+    int32_t flags = android_atomic_acquire_load(&mCblk->mFlags);
 
     status_t status = NO_ERROR;
     if (!(flags & CBLK_INVALID)) {
@@ -667,7 +667,7 @@
     mLock.lock();
 
     // Can only reference mCblk while locked
-    int32_t flags = android_atomic_and(~CBLK_OVERRUN, &mCblk->flags);
+    int32_t flags = android_atomic_and(~CBLK_OVERRUN, &mCblk->mFlags);
 
     // Check for track invalidation
     if (flags & CBLK_INVALID) {
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 3653b7f..64a59be 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -389,7 +389,7 @@
         mProxy->setEpoch(mProxy->getEpoch() - mProxy->getPosition());
     }
     mNewPosition = mProxy->getPosition() + mUpdatePeriod;
-    int32_t flags = android_atomic_and(~CBLK_DISABLED, &mCblk->flags);
+    int32_t flags = android_atomic_and(~CBLK_DISABLED, &mCblk->mFlags);
 
     sp<AudioTrackThread> t = mAudioTrackThread;
     if (t != 0) {
@@ -1182,7 +1182,7 @@
     // restart track if it was disabled by audioflinger due to previous underrun
     if (mState == STATE_ACTIVE) {
         audio_track_cblk_t* cblk = mCblk;
-        if (android_atomic_and(~CBLK_DISABLED, &cblk->flags) & CBLK_DISABLED) {
+        if (android_atomic_and(~CBLK_DISABLED, &cblk->mFlags) & CBLK_DISABLED) {
             ALOGW("releaseBuffer() track %p name=%#x disabled due to previous underrun, restarting",
                     this, cblk->mName);
             // FIXME ignoring status
@@ -1261,16 +1261,16 @@
     // fails indicating that the server is dead, flag the track as invalid so
     // we can attempt to restore in just a bit.
     audio_track_cblk_t* cblk = mCblk;
-    if (!(cblk->flags & CBLK_INVALID)) {
+    if (!(cblk->mFlags & CBLK_INVALID)) {
         result = mAudioTrack->allocateTimedBuffer(size, buffer);
         if (result == DEAD_OBJECT) {
-            android_atomic_or(CBLK_INVALID, &cblk->flags);
+            android_atomic_or(CBLK_INVALID, &cblk->mFlags);
         }
     }
 
     // If the track is invalid at this point, attempt to restore it. and try the
     // allocation one more time.
-    if (cblk->flags & CBLK_INVALID) {
+    if (cblk->mFlags & CBLK_INVALID) {
         result = restoreTrack_l("allocateTimedBuffer");
 
         if (result == NO_ERROR) {
@@ -1290,8 +1290,8 @@
         audio_track_cblk_t* cblk = mCblk;
         // restart track if it was disabled by audioflinger due to previous underrun
         if (buffer->size() != 0 && status == NO_ERROR &&
-                (mState == STATE_ACTIVE) && (cblk->flags & CBLK_DISABLED)) {
-            android_atomic_and(~CBLK_DISABLED, &cblk->flags);
+                (mState == STATE_ACTIVE) && (cblk->mFlags & CBLK_DISABLED)) {
+            android_atomic_and(~CBLK_DISABLED, &cblk->mFlags);
             ALOGW("queueTimedBuffer() track %p disabled, restarting", this);
             // FIXME ignoring status
             mAudioTrack->start();
@@ -1339,7 +1339,7 @@
 
     // Can only reference mCblk while locked
     int32_t flags = android_atomic_and(
-        ~(CBLK_UNDERRUN | CBLK_LOOP_CYCLE | CBLK_LOOP_FINAL | CBLK_BUFFER_END), &mCblk->flags);
+        ~(CBLK_UNDERRUN | CBLK_LOOP_CYCLE | CBLK_LOOP_FINAL | CBLK_BUFFER_END), &mCblk->mFlags);
 
     // Check for track invalidation
     if (flags & CBLK_INVALID) {
@@ -1681,7 +1681,7 @@
             // the actual amount of audio frames played (e.g SoundPool) receives them.
             if (mSharedBuffer == 0) {
                 // restart playback even if buffer is not completely filled.
-                android_atomic_or(CBLK_FORCEREADY, &mCblk->flags);
+                android_atomic_or(CBLK_FORCEREADY, &mCblk->mFlags);
             }
         }
 #endif
diff --git a/media/libmedia/AudioTrackShared.cpp b/media/libmedia/AudioTrackShared.cpp
index e5f7fcd..5015b8d 100644
--- a/media/libmedia/AudioTrackShared.cpp
+++ b/media/libmedia/AudioTrackShared.cpp
@@ -27,7 +27,7 @@
 
 audio_track_cblk_t::audio_track_cblk_t()
     : mServer(0), frameCount_(0), mFutex(0), mMinimum(0),
-    mVolumeLR(0x10001000), mSampleRate(0), mSendLevel(0), mName(0), flags(0)
+    mVolumeLR(0x10001000), mSampleRate(0), mSendLevel(0), mName(0), mFlags(0)
 {
     memset(&u, 0, sizeof(u));
 }
@@ -99,7 +99,7 @@
         goto end;
     }
     for (;;) {
-        int32_t flags = android_atomic_and(~CBLK_INTERRUPT, &cblk->flags);
+        int32_t flags = android_atomic_and(~CBLK_INTERRUPT, &cblk->mFlags);
         // check for track invalidation by server, or server death detection
         if (flags & CBLK_INVALID) {
             ALOGV("Track invalidated");
@@ -293,7 +293,7 @@
 void ClientProxy::binderDied()
 {
     audio_track_cblk_t* cblk = mCblk;
-    if (!(android_atomic_or(CBLK_INVALID, &cblk->flags) & CBLK_INVALID)) {
+    if (!(android_atomic_or(CBLK_INVALID, &cblk->mFlags) & CBLK_INVALID)) {
         // it seems that a FUTEX_WAKE_PRIVATE will not wake a FUTEX_WAIT, even within same process
         (void) __futex_syscall3(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
                 1);
@@ -303,7 +303,7 @@
 void ClientProxy::interrupt()
 {
     audio_track_cblk_t* cblk = mCblk;
-    if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->flags) & CBLK_INTERRUPT)) {
+    if (!(android_atomic_or(CBLK_INTERRUPT, &cblk->mFlags) & CBLK_INTERRUPT)) {
         (void) __futex_syscall3(&cblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
                 1);
     }
@@ -324,11 +324,11 @@
 }
 
 bool AudioTrackClientProxy::clearStreamEndDone() {
-    return (android_atomic_and(~CBLK_STREAM_END_DONE, &mCblk->flags) & CBLK_STREAM_END_DONE) != 0;
+    return (android_atomic_and(~CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0;
 }
 
 bool AudioTrackClientProxy::getStreamEndDone() const {
-    return (mCblk->flags & CBLK_STREAM_END_DONE) != 0;
+    return (mCblk->mFlags & CBLK_STREAM_END_DONE) != 0;
 }
 
 status_t AudioTrackClientProxy::waitStreamEndDone(const struct timespec *requested)
@@ -354,7 +354,7 @@
         timeout = TIMEOUT_FINITE;
     }
     for (;;) {
-        int32_t flags = android_atomic_and(~(CBLK_INTERRUPT|CBLK_STREAM_END_DONE), &cblk->flags);
+        int32_t flags = android_atomic_and(~(CBLK_INTERRUPT|CBLK_STREAM_END_DONE), &cblk->mFlags);
         // check for track invalidation by server, or server death detection
         if (flags & CBLK_INVALID) {
             ALOGV("Track invalidated");
@@ -653,7 +653,7 @@
 
 bool  AudioTrackServerProxy::setStreamEndDone() {
     bool old =
-            (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->flags) & CBLK_STREAM_END_DONE) != 0;
+            (android_atomic_or(CBLK_STREAM_END_DONE, &mCblk->mFlags) & CBLK_STREAM_END_DONE) != 0;
     if (!old) {
         (void) __futex_syscall3(&mCblk->mFutex, mClientInServer ? FUTEX_WAKE_PRIVATE : FUTEX_WAKE,
                 1);
@@ -808,7 +808,7 @@
     cblk->mServer += stepCount;
     cblk->u.mStatic.mBufferPosition = newPosition;
     if (setFlags != 0) {
-        (void) android_atomic_or(setFlags, &cblk->flags);
+        (void) android_atomic_or(setFlags, &cblk->mFlags);
         // this would be a good place to wake a futex
     }