Merge "Remove dead mutex in AudioTrack/AudioRecord thread"
diff --git a/include/media/AudioRecord.h b/include/media/AudioRecord.h
index c8c5dba..ca57f9e 100644
--- a/include/media/AudioRecord.h
+++ b/include/media/AudioRecord.h
@@ -344,7 +344,6 @@
virtual status_t readyToRun() { return NO_ERROR; }
virtual void onFirstRef() {}
AudioRecord& mReceiver;
- Mutex mLock;
};
bool processAudioBuffer(const sp<ClientRecordThread>& thread);
diff --git a/include/media/AudioTrack.h b/include/media/AudioTrack.h
index 9a42bc1..11db81b 100644
--- a/include/media/AudioTrack.h
+++ b/include/media/AudioTrack.h
@@ -446,7 +446,6 @@
virtual status_t readyToRun();
virtual void onFirstRef();
AudioTrack& mReceiver;
- Mutex mLock;
};
bool processAudioBuffer(const sp<AudioTrackThread>& thread);
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp
index c96bc76..b74b3e3 100644
--- a/media/libmedia/AudioRecord.cpp
+++ b/media/libmedia/AudioRecord.cpp
@@ -293,7 +293,6 @@
return WOULD_BLOCK;
}
}
- t->mLock.lock();
}
AutoMutex lock(mLock);
@@ -334,10 +333,6 @@
}
}
- if (t != 0) {
- t->mLock.unlock();
- }
-
return ret;
}
@@ -347,10 +342,6 @@
ALOGV("stop");
- if (t != 0) {
- t->mLock.lock();
- }
-
AutoMutex lock(mLock);
if (mActive == 1) {
mActive = 0;
@@ -367,10 +358,6 @@
}
}
- if (t != 0) {
- t->mLock.unlock();
- }
-
return NO_ERROR;
}
diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp
index 233cf75..087d7b2 100644
--- a/media/libmedia/AudioTrack.cpp
+++ b/media/libmedia/AudioTrack.cpp
@@ -345,7 +345,6 @@
return;
}
}
- t->mLock.lock();
}
AutoMutex lock(mLock);
@@ -396,9 +395,6 @@
}
}
- if (t != 0) {
- t->mLock.unlock();
- }
}
void AudioTrack::stop()
@@ -406,9 +402,6 @@
sp<AudioTrackThread> t = mAudioTrackThread;
ALOGV("stop %p", this);
- if (t != 0) {
- t->mLock.lock();
- }
AutoMutex lock(mLock);
if (mActive) {
@@ -434,9 +427,6 @@
}
}
- if (t != 0) {
- t->mLock.unlock();
- }
}
bool AudioTrack::stopped() const