diff options
author | Glenn Kasten <gkasten@google.com> | 2013-09-20 15:08:27 -0700 |
---|---|---|
committer | Android Git Automerger <android-git-automerger@android.com> | 2013-09-20 15:08:27 -0700 |
commit | e97d1ba9471a71c6b18cee23c98535d553303dac (patch) | |
tree | 3b42c97508a1d5ffece6a3cbb79ee01a0ca551fb /media/libmedia | |
parent | f2c643c89e405b57c7ce42067b876fb80031e5fa (diff) | |
parent | 4b701cc041d635e5ec56e382043a4c5d01aedd80 (diff) | |
download | frameworks_av-e97d1ba9471a71c6b18cee23c98535d553303dac.zip frameworks_av-e97d1ba9471a71c6b18cee23c98535d553303dac.tar.gz frameworks_av-e97d1ba9471a71c6b18cee23c98535d553303dac.tar.bz2 |
am 4b701cc0: Merge "Revert "Workaround slow AudioTrack destruction"" into klp-dev
* commit '4b701cc041d635e5ec56e382043a4c5d01aedd80':
Revert "Workaround slow AudioTrack destruction"
Diffstat (limited to 'media/libmedia')
-rw-r--r-- | media/libmedia/SoundPool.cpp | 23 |
1 files changed, 0 insertions, 23 deletions
diff --git a/media/libmedia/SoundPool.cpp b/media/libmedia/SoundPool.cpp index 37b400c..5239b2f 100644 --- a/media/libmedia/SoundPool.cpp +++ b/media/libmedia/SoundPool.cpp @@ -537,18 +537,6 @@ void SoundChannel::init(SoundPool* soundPool) mSoundPool = soundPool; } -// This class is used to destroy a RefBase asynchronously -class AsyncDestructThread : public Thread -{ -public: - AsyncDestructThread(sp<RefBase> refBase) : mRefBase(refBase) { } -protected: - virtual ~AsyncDestructThread() { } -private: - virtual bool threadLoop() { return false; } - const sp<RefBase> mRefBase; -}; - // call with sound pool lock held void SoundChannel::play(const sp<Sample>& sample, int nextChannelID, float leftVolume, float rightVolume, int priority, int loop, float rate) @@ -653,17 +641,6 @@ exit: if (status != NO_ERROR) { mAudioTrack.clear(); } - // FIXME AudioTrack destruction should not be slow - if (oldTrack != 0) { - // must be a raw reference to avoid a race after run() - AsyncDestructThread *adt = new AsyncDestructThread(oldTrack); - // guaranteed to not run destructor - oldTrack.clear(); - // after the run(), adt thread will hold a strong reference to oldTrack, - // and the only strong reference to itself - adt->run("AsyncDestruct"); - // do not delete adt here: adt thread destroys itself, and oldTrack if needed - } } void SoundChannel::nextEvent() |