Loading media/jni/soundpool/SoundDecoder.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ void SoundDecoder::loadSound(int32_t soundID) } // Launch threads as needed. The "as needed" is weakly consistent as we release mLock. if (pendingSounds > mThreadPool->getActiveThreadCount()) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } } Loading media/jni/soundpool/Stream.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ void Stream::stop() void Stream::stop_l() { if (mState != IDLE) { ALOGV("%s: track streamID: %d", __func__, (int)mStreamID); ALOGV("%s: track(%p) streamID: %d", __func__, mAudioTrack.get(), (int)mStreamID); if (mAudioTrack != nullptr) { mAudioTrack->stop(); } Loading Loading @@ -232,7 +232,7 @@ Stream* Stream::playPairStream() { LOG_ALWAYS_FATAL_IF(pairStream == nullptr, "No pair stream!"); sp<AudioTrack> releaseTracks[2]; { ALOGV("%s: track streamID: %d", __func__, (int)mStreamID); ALOGV("%s: track streamID: %d", __func__, (int)getStreamID()); // TODO: Do we really want to force a simultaneous synchronization between // the stream and its pair? Loading Loading @@ -390,10 +390,10 @@ void Stream::staticCallback(int event, void* user, void* info) void Stream::callback(int event, void* info, int toggle, int tries) { ALOGV("%s streamID %d", __func__, (int)mStreamID); int32_t activeStreamIDToRestart = 0; { std::unique_lock lock(mLock); ALOGV("%s track(%p) streamID %d", __func__, mAudioTrack.get(), (int)mStreamID); if (mAudioTrack == nullptr) { // The AudioTrack is either with this stream or its pair. Loading @@ -403,6 +403,7 @@ void Stream::callback(int event, void* info, int toggle, int tries) // logic here. if (tries < 3) { lock.unlock(); ALOGV("%s streamID %d going to pair stream", __func__, (int)mStreamID); getPairStream()->callback(event, info, toggle, tries + 1); } else { ALOGW("%s streamID %d cannot find track", __func__, (int)mStreamID); Loading Loading @@ -449,8 +450,9 @@ void Stream::callback(int event, void* info, int toggle, int tries) void Stream::dump() const { // TODO: consider std::try_lock() - ok for now for ALOGV. ALOGV("mPairStream=%p, mState=%d, mStreamID=%d, mSoundID=%d, mPriority=%d, mLoop=%d", getPairStream(), mState, (int)mStreamID, mSoundID, mPriority, mLoop); getPairStream(), mState, (int)getStreamID(), getSoundID(), mPriority, mLoop); } } // namespace android::soundpool media/jni/soundpool/Stream.h +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public: void resume(int32_t streamID); void autoResume(); void mute(bool muting); void dump() const; void dump() const NO_THREAD_SAFETY_ANALYSIS; // disable for ALOGV (see func for details). // returns the pair stream if successful, nullptr otherwise Stream* playPairStream(); Loading media/jni/soundpool/StreamManager.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -249,7 +249,8 @@ int32_t StreamManager::queueForPlay(const std::shared_ptr<Sound> &sound, } // lock if (launchThread) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } ALOGV("%s: returning %d", __func__, streamID); Loading Loading @@ -277,7 +278,8 @@ void StreamManager::moveToRestartQueue( sanityCheckQueue_l(); } if (restart) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } } Loading Loading
media/jni/soundpool/SoundDecoder.cpp +2 −1 Original line number Diff line number Diff line Loading @@ -107,7 +107,8 @@ void SoundDecoder::loadSound(int32_t soundID) } // Launch threads as needed. The "as needed" is weakly consistent as we release mLock. if (pendingSounds > mThreadPool->getActiveThreadCount()) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } } Loading
media/jni/soundpool/Stream.cpp +6 −4 Original line number Diff line number Diff line Loading @@ -203,7 +203,7 @@ void Stream::stop() void Stream::stop_l() { if (mState != IDLE) { ALOGV("%s: track streamID: %d", __func__, (int)mStreamID); ALOGV("%s: track(%p) streamID: %d", __func__, mAudioTrack.get(), (int)mStreamID); if (mAudioTrack != nullptr) { mAudioTrack->stop(); } Loading Loading @@ -232,7 +232,7 @@ Stream* Stream::playPairStream() { LOG_ALWAYS_FATAL_IF(pairStream == nullptr, "No pair stream!"); sp<AudioTrack> releaseTracks[2]; { ALOGV("%s: track streamID: %d", __func__, (int)mStreamID); ALOGV("%s: track streamID: %d", __func__, (int)getStreamID()); // TODO: Do we really want to force a simultaneous synchronization between // the stream and its pair? Loading Loading @@ -390,10 +390,10 @@ void Stream::staticCallback(int event, void* user, void* info) void Stream::callback(int event, void* info, int toggle, int tries) { ALOGV("%s streamID %d", __func__, (int)mStreamID); int32_t activeStreamIDToRestart = 0; { std::unique_lock lock(mLock); ALOGV("%s track(%p) streamID %d", __func__, mAudioTrack.get(), (int)mStreamID); if (mAudioTrack == nullptr) { // The AudioTrack is either with this stream or its pair. Loading @@ -403,6 +403,7 @@ void Stream::callback(int event, void* info, int toggle, int tries) // logic here. if (tries < 3) { lock.unlock(); ALOGV("%s streamID %d going to pair stream", __func__, (int)mStreamID); getPairStream()->callback(event, info, toggle, tries + 1); } else { ALOGW("%s streamID %d cannot find track", __func__, (int)mStreamID); Loading Loading @@ -449,8 +450,9 @@ void Stream::callback(int event, void* info, int toggle, int tries) void Stream::dump() const { // TODO: consider std::try_lock() - ok for now for ALOGV. ALOGV("mPairStream=%p, mState=%d, mStreamID=%d, mSoundID=%d, mPriority=%d, mLoop=%d", getPairStream(), mState, (int)mStreamID, mSoundID, mPriority, mLoop); getPairStream(), mState, (int)getStreamID(), getSoundID(), mPriority, mLoop); } } // namespace android::soundpool
media/jni/soundpool/Stream.h +1 −1 Original line number Diff line number Diff line Loading @@ -88,7 +88,7 @@ public: void resume(int32_t streamID); void autoResume(); void mute(bool muting); void dump() const; void dump() const NO_THREAD_SAFETY_ANALYSIS; // disable for ALOGV (see func for details). // returns the pair stream if successful, nullptr otherwise Stream* playPairStream(); Loading
media/jni/soundpool/StreamManager.cpp +4 −2 Original line number Diff line number Diff line Loading @@ -249,7 +249,8 @@ int32_t StreamManager::queueForPlay(const std::shared_ptr<Sound> &sound, } // lock if (launchThread) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } ALOGV("%s: returning %d", __func__, streamID); Loading Loading @@ -277,7 +278,8 @@ void StreamManager::moveToRestartQueue( sanityCheckQueue_l(); } if (restart) { const int32_t id __unused = mThreadPool->launch([this](int32_t id) { run(id); }); const int32_t id = mThreadPool->launch([this](int32_t id) { run(id); }); (void)id; // avoid clang warning -Wunused-variable -Wused-but-marked-unused ALOGV_IF(id != 0, "%s: launched thread %d", __func__, id); } } Loading