DO NOT MERGE SoundPool: add lock for findSample access from SoundPoolThread
Sample decoding still occurs in SoundPoolThread
without holding the SoundPool lock.
Bug: 25781119
Change-Id: I11fde005aa9cf5438e0390a0d2dfe0ec1dd282e8
diff --git a/include/media/SoundPool.h b/include/media/SoundPool.h
index 2dd78cc..1b21a36 100644
--- a/include/media/SoundPool.h
+++ b/include/media/SoundPool.h
@@ -188,6 +188,7 @@
// called from SoundPoolThread
void sampleLoaded(int sampleID);
+ sp<Sample> findSample(int sampleID);
// called from AudioTrack thread
void done_l(SoundChannel* channel);
@@ -199,8 +200,7 @@
private:
SoundPool() {} // no default constructor
bool startThreads();
- void doLoad(sp<Sample>& sample);
- sp<Sample> findSample(int sampleID) { return mSamples.valueFor(sampleID); }
+ sp<Sample> findSample_l(int sampleID);
SoundChannel* findChannel (int channelID);
SoundChannel* findNextChannel (int channelID);
SoundChannel* allocateChannel_l(int priority);