Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions internal/oboe/oboe_opensles_OutputMixerOpenSLES_android.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,15 +50,17 @@ SLresult OutputMixerOpenSL::open() {
return result;

error:
close();
closeLocked();
return result;
}

void OutputMixerOpenSL::close() {
std::lock_guard<std::mutex> lock(mLock);
closeLocked();
}

void OutputMixerOpenSL::closeLocked() {
if (--mOpenCount == 0) {
// destroy output mix object, and invalidate all associated interfaces
if (mOutputMixObject != nullptr) {
(*mOutputMixObject)->Destroy(mOutputMixObject);
mOutputMixObject = nullptr;
Expand Down
2 changes: 2 additions & 0 deletions internal/oboe/oboe_opensles_OutputMixerOpenSLES_android.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@ class OutputMixerOpenSL {
SLDataSource *audioSource);

private:
void closeLocked();

// Make this a safe Singleton
OutputMixerOpenSL()= default;
~OutputMixerOpenSL()= default;
Expand Down
Loading