aboutsummaryrefslogtreecommitdiffstats
path: root/alc/backends/jack.cpp
diff options
context:
space:
mode:
authorChris Robinson <[email protected]>2020-03-29 23:57:37 -0700
committerChris Robinson <[email protected]>2020-03-29 23:57:37 -0700
commit9b237790b274a9191e0835e84c28de6cefbc2d34 (patch)
tree83c696bb61d947e5c4ab3c79adf2308d918ef29c /alc/backends/jack.cpp
parentd70912c0345e402e8aed9835ce450330cd6a7d36 (diff)
Remove the mutex from the backend base
Diffstat (limited to 'alc/backends/jack.cpp')
-rw-r--r--alc/backends/jack.cpp6
1 files changed, 4 insertions, 2 deletions
diff --git a/alc/backends/jack.cpp b/alc/backends/jack.cpp
index 7e91f28c..0cad064d 100644
--- a/alc/backends/jack.cpp
+++ b/alc/backends/jack.cpp
@@ -169,6 +169,8 @@ struct JackPlayback final : public BackendBase {
jack_client_t *mClient{nullptr};
jack_port_t *mPort[MAX_OUTPUT_CHANNELS]{};
+ std::mutex mMutex;
+
std::atomic<bool> mPlaying{false};
RingBufferPtr mRing;
al::semaphore mSem;
@@ -282,7 +284,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};
+ std::lock_guard<std::mutex> _{mMutex};
aluMixData(mDevice, data.first.buf, len1, frame_step);
if(len2 > 0)
aluMixData(mDevice, data.second.buf, len2, frame_step);
@@ -458,7 +460,7 @@ ClockLatency JackPlayback::getClockLatency()
{
ClockLatency ret;
- std::lock_guard<std::recursive_mutex> _{mMutex};
+ std::lock_guard<std::mutex> _{mMutex};
ret.ClockTime = GetDeviceClockTime(mDevice);
ret.Latency = std::chrono::seconds{mRing->readSpace()};
ret.Latency /= mDevice->Frequency;