From 9b237790b274a9191e0835e84c28de6cefbc2d34 Mon Sep 17 00:00:00 2001 From: Chris Robinson Date: Sun, 29 Mar 2020 23:57:37 -0700 Subject: Remove the mutex from the backend base --- alc/backends/opensl.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'alc/backends/opensl.cpp') diff --git a/alc/backends/opensl.cpp b/alc/backends/opensl.cpp index 635d6c0d..b1355061 100644 --- a/alc/backends/opensl.cpp +++ b/alc/backends/opensl.cpp @@ -171,6 +171,8 @@ struct OpenSLPlayback final : public BackendBase { RingBufferPtr mRing{nullptr}; al::semaphore mSem; + std::mutex mMutex; + ALuint mFrameSize{0}; std::atomic mKillNow{true}; @@ -260,7 +262,7 @@ int OpenSLPlayback::mixerProc() } } - std::unique_lock dlock{mMutex}; + std::unique_lock dlock{mMutex}; auto data = mRing->getWriteVector(); aluMixData(mDevice, data.first.buf, static_cast(data.first.len*mDevice->UpdateSize), frame_step); @@ -610,7 +612,7 @@ ClockLatency OpenSLPlayback::getClockLatency() { ClockLatency ret; - std::lock_guard _{mMutex}; + std::lock_guard _{mMutex}; ret.ClockTime = GetDeviceClockTime(mDevice); ret.Latency = std::chrono::seconds{mRing->readSpace() * mDevice->UpdateSize}; ret.Latency /= mDevice->Frequency; -- cgit v1.2.3