summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndy Hung <hunga@google.com>2021-11-28 23:30:02 -0800
committerAndy Hung <hunga@google.com>2021-12-09 10:03:26 -0800
commit151117ec0bb69b5a4829baecaa23b9324745fdd4 (patch)
treec9a04140797b1eab04287ea87c98e4fecf982036
parent8d221843b767e18c04c82bb972c8bbdfd459742b (diff)
downloadbase-151117ec0bb69b5a4829baecaa23b9324745fdd4.tar.gz
SoundPool: Update queue only if streamID matches
SoundPool API commands are based on an atomic compare-StreamID if match then operate (see compare-exchange). Test: soundpool_stress Test: atest SoundPoolAacTest Test: atest SoundPoolHapticTest Test: atest SoundPoolMidiTest Test: atest SoundPoolOggTest Bug: 201233890 Bug: 201262390 Change-Id: I63cc07d581a0ac1d5440852bfe0c75edc9d73e75
-rw-r--r--media/jni/soundpool/SoundPool.cpp2
1 files changed, 1 insertions, 1 deletions
diff --git a/media/jni/soundpool/SoundPool.cpp b/media/jni/soundpool/SoundPool.cpp
index 253b4e3a8a09..00c4a9782f33 100644
--- a/media/jni/soundpool/SoundPool.cpp
+++ b/media/jni/soundpool/SoundPool.cpp
@@ -185,7 +185,7 @@ void SoundPool::stop(int32_t streamID)
auto apiLock = kUseApiLock ? std::make_unique<std::lock_guard<std::mutex>>(mApiLock) : nullptr;
soundpool::Stream* stream = mStreamManager.findStream(streamID);
if (stream != nullptr && stream->requestStop(streamID)) {
- mStreamManager.moveToRestartQueue(stream);
+ mStreamManager.moveToRestartQueue(stream, streamID);
}
}