aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/jack.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-02-26 04:58:02 -0800
committerChris Robinson <[email protected]>2020-02-26 04:58:02 -0800
commiteb49290dabd5ca317337663ff7e8b25a311b83a8 (patch)
treed5d9c6bb50bc6b5dc1804ee88ca497c8b50111ac /alc/backends/jack.cpp
parent4555b74bd75614418032bd46836b0335229d48d4 (diff)
Remove unnecessary locks now that the mixer doesn't require one
Diffstat (limited to 'alc/backends/jack.cpp')
-rw-r--r--alc/backends/jack.cpp6
1 files changed, 2 insertions, 4 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp
index 485225e4..97837460 100644
--- a/alc/backends/jack.cpp
+++ b/alc/backends/jack.cpp
@@ -266,15 +266,12 @@ int JackPlayback::mixerProc()
const size_t frame_step{mDevice->channelsFromFmt()};
- std::unique_lock<JackPlayback> dlock{*this};
while(!mKillNow.load(std::memory_order_acquire) &&
mDevice->Connected.load(std::memory_order_acquire))
{
if(mRing->writeSpace() < mDevice->UpdateSize)
{
- dlock.unlock();
mSem.wait();
- dlock.lock();
continue;
}
@@ -285,6 +282,7 @@ int JackPlayback::mixerProc()
ALuint len1{minu(static_cast<ALuint>(data.first.len), todo)};
ALuint len2{minu(static_cast<ALuint>(data.second.len), todo-len1)};
+ std::lock_guard<std::recursive_mutex> _{mMutex};
aluMixData(mDevice, data.first.buf, len1, frame_step);
if(len2 > 0)
aluMixData(mDevice, data.second.buf, len2, frame_step);
@@ -460,7 +458,7 @@ ClockLatency JackPlayback::getClockLatency()
{
ClockLatency ret;
- std::lock_guard<JackPlayback> _{*this};
+ std::lock_guard<std::recursive_mutex> _{mMutex};
ret.ClockTime = GetDeviceClockTime(mDevice);
ret.Latency = std::chrono::seconds{mRing->readSpace()};
ret.Latency /= mDevice->Frequency;