diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index b258ed1fd..abacb099a 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -796,6 +796,9 @@ AlsaOutput::Drain() inline void AlsaOutput::CancelInternal() noexcept { + /* this method doesn't need to lock the mutex because while it + runs, the calling thread is blocked inside Cancel() */ + must_prepare = true; snd_pcm_drop(pcm); @@ -804,10 +807,7 @@ AlsaOutput::CancelInternal() noexcept period_buffer.Clear(); ring_buffer->reset(); - { - const std::lock_guard lock(mutex); - active = false; - } + active = false; MultiSocketMonitor::Reset(); defer_invalidate_sockets.Cancel();