summaryrefslogtreecommitdiffstats
path: root/services/audioflinger
diff options
context:
space:
mode:
authorGlenn Kasten <gkasten@google.com>2013-07-29 14:27:55 +0000
committerAndroid (Google) Code Review <android-gerrit@google.com>2013-07-29 14:27:56 +0000
commitafbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d (patch)
tree6fc44421938fc9a08c232580f581b89f95259ed3 /services/audioflinger
parent420ea49539d23ab305a7b33c0854a7a475493dd4 (diff)
parenta8356f663014e7d4c27869629af83d8bb3441e19 (diff)
downloadframeworks_av-afbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d.zip
frameworks_av-afbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d.tar.gz
frameworks_av-afbbc6c5f6bc470d504dcf24ceb3ac21d57fb78d.tar.bz2
Merge "Simplify RecordTrack::stop()"
Diffstat (limited to 'services/audioflinger')
-rw-r--r--services/audioflinger/Threads.cpp3
-rw-r--r--services/audioflinger/Threads.h2
-rw-r--r--services/audioflinger/Tracks.cpp7
3 files changed, 4 insertions, 8 deletions
diff --git a/services/audioflinger/Threads.cpp b/services/audioflinger/Threads.cpp
index a61b412..07f815e 100644
--- a/services/audioflinger/Threads.cpp
+++ b/services/audioflinger/Threads.cpp
@@ -4588,8 +4588,9 @@ void AudioFlinger::RecordThread::handleSyncStartEvent(const sp<SyncEvent>& event
}
}
-bool AudioFlinger::RecordThread::stop_l(RecordThread::RecordTrack* recordTrack) {
+bool AudioFlinger::RecordThread::stop(RecordThread::RecordTrack* recordTrack) {
ALOGV("RecordThread::stop");
+ AutoMutex _l(mLock);
if (recordTrack != mActiveTrack.get() || recordTrack->mState == TrackBase::PAUSING) {
return false;
}
diff --git a/services/audioflinger/Threads.h b/services/audioflinger/Threads.h
index 7c7c6f0..c5818ae 100644
--- a/services/audioflinger/Threads.h
+++ b/services/audioflinger/Threads.h
@@ -840,7 +840,7 @@ public:
// ask the thread to stop the specified track, and
// return true if the caller should then do it's part of the stopping process
- bool stop_l(RecordTrack* recordTrack);
+ bool stop(RecordTrack* recordTrack);
void dump(int fd, const Vector<String16>& args);
AudioStreamIn* clearInput();
diff --git a/services/audioflinger/Tracks.cpp b/services/audioflinger/Tracks.cpp
index 75ffcc2..52518ae 100644
--- a/services/audioflinger/Tracks.cpp
+++ b/services/audioflinger/Tracks.cpp
@@ -1705,12 +1705,7 @@ void AudioFlinger::RecordThread::RecordTrack::stop()
sp<ThreadBase> thread = mThread.promote();
if (thread != 0) {
RecordThread *recordThread = (RecordThread *)thread.get();
- recordThread->mLock.lock();
- bool doStop = recordThread->stop_l(this);
- if (doStop) {
- }
- recordThread->mLock.unlock();
- if (doStop) {
+ if (recordThread->stop(this)) {
AudioSystem::stopInput(recordThread->id());
}
}