diff options
author | Chris Robinson <[email protected]> | 2020-02-26 04:58:02 -0800 |
---|---|---|
committer | Chris Robinson <[email protected]> | 2020-02-26 04:58:02 -0800 |
commit | eb49290dabd5ca317337663ff7e8b25a311b83a8 (patch) | |
tree | d5d9c6bb50bc6b5dc1804ee88ca497c8b50111ac /alc/backends/wasapi.cpp | |
parent | 4555b74bd75614418032bd46836b0335229d48d4 (diff) |
Remove unnecessary locks now that the mixer doesn't require one
Diffstat (limited to 'alc/backends/wasapi.cpp')
-rw-r--r-- | alc/backends/wasapi.cpp | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/alc/backends/wasapi.cpp b/alc/backends/wasapi.cpp index f97c8636..4addad1d 100644 --- a/alc/backends/wasapi.cpp +++ b/alc/backends/wasapi.cpp @@ -715,10 +715,11 @@ FORCE_ALIGN int WasapiPlayback::mixerProc() hr = mRender->GetBuffer(len, &buffer); if(SUCCEEDED(hr)) { - std::unique_lock<WasapiPlayback> dlock{*this}; - aluMixData(mDevice, buffer, len, mFrameStep); - mPadding.store(written + len, std::memory_order_relaxed); - dlock.unlock(); + { + std::lock_guard<std::recursive_mutex> _{mMutex}; + aluMixData(mDevice, buffer, len, mFrameStep); + mPadding.store(written + len, std::memory_order_relaxed); + } hr = mRender->ReleaseBuffer(len, 0); } if(FAILED(hr)) @@ -1164,7 +1165,7 @@ ClockLatency WasapiPlayback::getClockLatency() { ClockLatency ret; - std::lock_guard<WasapiPlayback> _{*this}; + std::lock_guard<std::recursive_mutex> _{mMutex}; ret.ClockTime = GetDeviceClockTime(mDevice); ret.Latency = std::chrono::seconds{mPadding.load(std::memory_order_relaxed)}; ret.Latency /= mDevice->Frequency; |