From 2fb5dbe62bae1e5c0ae57bc56fa55a5ba8b191cb Mon Sep 17 00:00:00 2001 From: Max Kellermann Date: Mon, 16 Jul 2018 10:15:01 +0200 Subject: [PATCH] output/alsa: use spsc_queue::reset() This method was added in Boost 1.58. --- src/output/plugins/AlsaOutputPlugin.cxx | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/src/output/plugins/AlsaOutputPlugin.cxx b/src/output/plugins/AlsaOutputPlugin.cxx index fa440f097..778e9e3c5 100644 --- a/src/output/plugins/AlsaOutputPlugin.cxx +++ b/src/output/plugins/AlsaOutputPlugin.cxx @@ -255,11 +255,6 @@ private: return true; } - void ClearRingBuffer() noexcept { - std::array buffer; - while (ring_buffer->pop(&buffer.front(), buffer.size())) {} - } - int Recover(int err) noexcept; /** @@ -789,7 +784,7 @@ AlsaOutput::CancelInternal() noexcept pcm_export->Reset(); period_buffer.Clear(); - ClearRingBuffer(); + ring_buffer->reset(); { const std::lock_guard lock(mutex); @@ -809,7 +804,7 @@ AlsaOutput::Cancel() noexcept pcm_export->Reset(); assert(period_buffer.IsEmpty()); - ClearRingBuffer(); + ring_buffer->reset(); return; }