diff options
author | Max Kellermann <max@musicpd.org> | 2018-07-16 10:15:01 +0200 |
---|---|---|
committer | Max Kellermann <max@musicpd.org> | 2018-07-16 11:04:01 +0200 |
commit | 2fb5dbe62bae1e5c0ae57bc56fa55a5ba8b191cb (patch) | |
tree | 57ecbeac353a2905ffaa5696a2b72765db660f9e /src/output | |
parent | d2835e29890e3257238ee2832f3064692040118d (diff) |
output/alsa: use spsc_queue::reset()
This method was added in Boost 1.58.
Diffstat (limited to 'src/output')
-rw-r--r-- | src/output/plugins/AlsaOutputPlugin.cxx | 9 |
1 files 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<uint8_t, 1024> 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<Mutex> lock(mutex); @@ -809,7 +804,7 @@ AlsaOutput::Cancel() noexcept pcm_export->Reset(); assert(period_buffer.IsEmpty()); - ClearRingBuffer(); + ring_buffer->reset(); return; } |