output/alsa: use spsc_queue::reset()

This method was added in Boost 1.58.
This commit is contained in:
Max Kellermann 2018-07-16 10:15:01 +02:00
parent d2835e2989
commit 2fb5dbe62b

View File

@ -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;
}