diff options
author | Andy Hung <hunga@google.com> | 2021-11-28 23:30:02 -0800 |
---|---|---|
committer | Andy Hung <hunga@google.com> | 2021-12-09 10:03:26 -0800 |
commit | 151117ec0bb69b5a4829baecaa23b9324745fdd4 (patch) | |
tree | c9a04140797b1eab04287ea87c98e4fecf982036 | |
parent | 8d221843b767e18c04c82bb972c8bbdfd459742b (diff) | |
download | base-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.cpp | 2 |
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); } } |