Loading media/libmedia/AudioRecord.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -105,6 +105,8 @@ AudioRecord::~AudioRecord() } } mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioRecord.clear(); mAudioRecord.clear(); mCblkMemory.clear(); mBufferMemory.clear(); IPCThreadState::self()->flushCommands(); IPCThreadState::self()->flushCommands(); AudioSystem::releaseAudioSessionId(mSessionId, -1); AudioSystem::releaseAudioSessionId(mSessionId, -1); } } Loading Loading @@ -546,9 +548,10 @@ status_t AudioRecord::openRecord_l(size_t epoch) mDeathNotifier.clear(); mDeathNotifier.clear(); } } mAudioRecord = record; mAudioRecord = record; mCblkMemory = iMem; mCblkMemory = iMem; mBufferMemory = bufferMem; mBufferMemory = bufferMem; IPCThreadState::self()->flushCommands(); mCblk = cblk; mCblk = cblk; // note that temp is the (possibly revised) value of frameCount // note that temp is the (possibly revised) value of frameCount if (temp < frameCount || (frameCount == 0 && temp == 0)) { if (temp < frameCount || (frameCount == 0 && temp == 0)) { Loading media/libmedia/AudioTrack.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,8 @@ AudioTrack::~AudioTrack() } } mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioTrack.clear(); mAudioTrack.clear(); mCblkMemory.clear(); mSharedBuffer.clear(); IPCThreadState::self()->flushCommands(); IPCThreadState::self()->flushCommands(); ALOGV("~AudioTrack, releasing session id from %d on behalf of %d", ALOGV("~AudioTrack, releasing session id from %d on behalf of %d", IPCThreadState::self()->getCallingPid(), mClientPid); IPCThreadState::self()->getCallingPid(), mClientPid); Loading Loading @@ -1059,8 +1061,9 @@ status_t AudioTrack::createTrack_l(size_t epoch) mDeathNotifier.clear(); mDeathNotifier.clear(); } } mAudioTrack = track; mAudioTrack = track; mCblkMemory = iMem; mCblkMemory = iMem; IPCThreadState::self()->flushCommands(); audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); mCblk = cblk; mCblk = cblk; // note that temp is the (possibly revised) value of frameCount // note that temp is the (possibly revised) value of frameCount Loading services/audioflinger/Tracks.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -223,6 +223,8 @@ AudioFlinger::ThreadBase::TrackBase::~TrackBase() // relying on the automatic clear() at end of scope. // relying on the automatic clear() at end of scope. mClient.clear(); mClient.clear(); } } // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } // AudioBufferProvider interface // AudioBufferProvider interface Loading Loading @@ -432,8 +434,6 @@ AudioFlinger::PlaybackThread::Track::~Track() // This prevents that leak. // This prevents that leak. if (mSharedBuffer != 0) { if (mSharedBuffer != 0) { mSharedBuffer.clear(); mSharedBuffer.clear(); // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } } } Loading Loading
media/libmedia/AudioRecord.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -105,6 +105,8 @@ AudioRecord::~AudioRecord() } } mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioRecord->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioRecord.clear(); mAudioRecord.clear(); mCblkMemory.clear(); mBufferMemory.clear(); IPCThreadState::self()->flushCommands(); IPCThreadState::self()->flushCommands(); AudioSystem::releaseAudioSessionId(mSessionId, -1); AudioSystem::releaseAudioSessionId(mSessionId, -1); } } Loading Loading @@ -546,9 +548,10 @@ status_t AudioRecord::openRecord_l(size_t epoch) mDeathNotifier.clear(); mDeathNotifier.clear(); } } mAudioRecord = record; mAudioRecord = record; mCblkMemory = iMem; mCblkMemory = iMem; mBufferMemory = bufferMem; mBufferMemory = bufferMem; IPCThreadState::self()->flushCommands(); mCblk = cblk; mCblk = cblk; // note that temp is the (possibly revised) value of frameCount // note that temp is the (possibly revised) value of frameCount if (temp < frameCount || (frameCount == 0 && temp == 0)) { if (temp < frameCount || (frameCount == 0 && temp == 0)) { Loading
media/libmedia/AudioTrack.cpp +4 −1 Original line number Original line Diff line number Diff line Loading @@ -174,6 +174,8 @@ AudioTrack::~AudioTrack() } } mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioTrack->asBinder()->unlinkToDeath(mDeathNotifier, this); mAudioTrack.clear(); mAudioTrack.clear(); mCblkMemory.clear(); mSharedBuffer.clear(); IPCThreadState::self()->flushCommands(); IPCThreadState::self()->flushCommands(); ALOGV("~AudioTrack, releasing session id from %d on behalf of %d", ALOGV("~AudioTrack, releasing session id from %d on behalf of %d", IPCThreadState::self()->getCallingPid(), mClientPid); IPCThreadState::self()->getCallingPid(), mClientPid); Loading Loading @@ -1059,8 +1061,9 @@ status_t AudioTrack::createTrack_l(size_t epoch) mDeathNotifier.clear(); mDeathNotifier.clear(); } } mAudioTrack = track; mAudioTrack = track; mCblkMemory = iMem; mCblkMemory = iMem; IPCThreadState::self()->flushCommands(); audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); audio_track_cblk_t* cblk = static_cast<audio_track_cblk_t*>(iMemPointer); mCblk = cblk; mCblk = cblk; // note that temp is the (possibly revised) value of frameCount // note that temp is the (possibly revised) value of frameCount Loading
services/audioflinger/Tracks.cpp +2 −2 Original line number Original line Diff line number Diff line Loading @@ -223,6 +223,8 @@ AudioFlinger::ThreadBase::TrackBase::~TrackBase() // relying on the automatic clear() at end of scope. // relying on the automatic clear() at end of scope. mClient.clear(); mClient.clear(); } } // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } // AudioBufferProvider interface // AudioBufferProvider interface Loading Loading @@ -432,8 +434,6 @@ AudioFlinger::PlaybackThread::Track::~Track() // This prevents that leak. // This prevents that leak. if (mSharedBuffer != 0) { if (mSharedBuffer != 0) { mSharedBuffer.clear(); mSharedBuffer.clear(); // flush the binder command buffer IPCThreadState::self()->flushCommands(); } } } } Loading