Loading libs/audioflinger/AudioFlinger.cpp +6 −5 Original line number Original line Diff line number Diff line Loading @@ -2277,10 +2277,8 @@ AudioFlinger::PlaybackThread::Track::~Track() LOGV("PlaybackThread::Track destructor"); LOGV("PlaybackThread::Track destructor"); sp<ThreadBase> thread = mThread.promote(); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { if (thread != 0) { thread->mLock.lock(); Mutex::Autolock _l(thread->mLock); mState = TERMINATED; mState = TERMINATED; thread->mLock.unlock(); AudioSystem::releaseOutput(thread->id()); } } } } Loading @@ -2298,9 +2296,12 @@ void AudioFlinger::PlaybackThread::Track::destroy() { // scope for mLock { // scope for mLock sp<ThreadBase> thread = mThread.promote(); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { if (thread != 0) { if (!isOutputTrack() && (mState == ACTIVE || mState == RESUMING)) { if (!isOutputTrack()) { if (mState == ACTIVE || mState == RESUMING) { AudioSystem::stopOutput(thread->id(), (AudioSystem::stream_type)mStreamType); AudioSystem::stopOutput(thread->id(), (AudioSystem::stream_type)mStreamType); } } AudioSystem::releaseOutput(thread->id()); } Mutex::Autolock _l(thread->mLock); Mutex::Autolock _l(thread->mLock); PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); playbackThread->destroyTrack_l(this); playbackThread->destroyTrack_l(this); Loading Loading
libs/audioflinger/AudioFlinger.cpp +6 −5 Original line number Original line Diff line number Diff line Loading @@ -2277,10 +2277,8 @@ AudioFlinger::PlaybackThread::Track::~Track() LOGV("PlaybackThread::Track destructor"); LOGV("PlaybackThread::Track destructor"); sp<ThreadBase> thread = mThread.promote(); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { if (thread != 0) { thread->mLock.lock(); Mutex::Autolock _l(thread->mLock); mState = TERMINATED; mState = TERMINATED; thread->mLock.unlock(); AudioSystem::releaseOutput(thread->id()); } } } } Loading @@ -2298,9 +2296,12 @@ void AudioFlinger::PlaybackThread::Track::destroy() { // scope for mLock { // scope for mLock sp<ThreadBase> thread = mThread.promote(); sp<ThreadBase> thread = mThread.promote(); if (thread != 0) { if (thread != 0) { if (!isOutputTrack() && (mState == ACTIVE || mState == RESUMING)) { if (!isOutputTrack()) { if (mState == ACTIVE || mState == RESUMING) { AudioSystem::stopOutput(thread->id(), (AudioSystem::stream_type)mStreamType); AudioSystem::stopOutput(thread->id(), (AudioSystem::stream_type)mStreamType); } } AudioSystem::releaseOutput(thread->id()); } Mutex::Autolock _l(thread->mLock); Mutex::Autolock _l(thread->mLock); PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); PlaybackThread *playbackThread = (PlaybackThread *)thread.get(); playbackThread->destroyTrack_l(this); playbackThread->destroyTrack_l(this); Loading