diff options
author | Eric Laurent <elaurent@google.com> | 2014-06-13 19:20:41 +0000 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2014-06-13 19:20:41 +0000 |
commit | 20d16a8af2dc95e827be693edabde4f09eb90c32 (patch) | |
tree | 31349f9325750c969742a7fd8daf30843d7c9255 /media | |
parent | 0d1004ad38955dffcb911656fc191eb29af9b4d5 (diff) | |
parent | 3bcffa136909c1fb6e88ee4efd12ccac18360a85 (diff) | |
download | frameworks_av-20d16a8af2dc95e827be693edabde4f09eb90c32.zip frameworks_av-20d16a8af2dc95e827be693edabde4f09eb90c32.tar.gz frameworks_av-20d16a8af2dc95e827be693edabde4f09eb90c32.tar.bz2 |
am 3bcffa13: force command flush after releasing a reference to shared memory
* commit '3bcffa136909c1fb6e88ee4efd12ccac18360a85':
force command flush after releasing a reference to shared memory
Diffstat (limited to 'media')
-rw-r--r-- | media/libmedia/AudioRecord.cpp | 5 | ||||
-rw-r--r-- | media/libmedia/AudioTrack.cpp | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/media/libmedia/AudioRecord.cpp b/media/libmedia/AudioRecord.cpp index db61e85..50b444a 100644 --- a/media/libmedia/AudioRecord.cpp +++ b/media/libmedia/AudioRecord.cpp @@ -105,6 +105,8 @@ AudioRecord::~AudioRecord() } mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioRecord.clear(); + mCblkMemory.clear(); + mBufferMemory.clear(); IPCThreadState::self()->flushCommands(); AudioSystem::releaseAudioSessionId(mSessionId, -1); } @@ -546,9 +548,10 @@ status_t AudioRecord::openRecord_l(size_t epoch) mDeathNotifier.clear(); } mAudioRecord = record; - mCblkMemory = iMem; mBufferMemory = bufferMem; + IPCThreadState::self()->flushCommands(); + mCblk = cblk; // note that temp is the (possibly revised) value of frameCount if (temp < frameCount || (frameCount == 0 && temp == 0)) { diff --git a/media/libmedia/AudioTrack.cpp b/media/libmedia/AudioTrack.cpp index 7d3ecc5..fa8e5c3 100644 --- a/media/libmedia/AudioTrack.cpp +++ b/media/libmedia/AudioTrack.cpp @@ -174,6 +174,8 @@ AudioTrack::~AudioTrack() } mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioTrack.clear(); + mCblkMemory.clear(); + mSharedBuffer.clear(); IPCThreadState::self()->flushCommands(); ALOGV("~AudioTrack, releasing session id from %d on behalf of %d", IPCThreadState::self()->getCallingPid(), mClientPid); @@ -1059,8 +1061,9 @@ status_t AudioTrack::createTrack_l(size_t epoch) mDeathNotifier.clear(); } mAudioTrack = track; - mCblkMemory = iMem; + IPCThreadState::self()->flushCommands(); + audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); mCblk = cblk; // note that temp is the (possibly revised) value of frameCount |