Commit d66f5a85 authored by Max Kellermann's avatar Max Kellermann

output/alsa: replace PeriodBuffer::IsEmpty() with IsCleared()

This assertion is not about whether all data has been consumed, but about whether there has been any data at all.
parent 30ca6b88
......@@ -65,8 +65,12 @@ public:
delete[] buffer;
}
bool IsEmpty() const noexcept {
return head == tail;
/**
* Has there no data been appended since the last Clear()
* call?
*/
bool IsCleared() const noexcept {
return tail == 0;
}
bool IsFull() const noexcept {
......
......@@ -857,7 +857,7 @@ AlsaOutput::Cancel() noexcept
synchronization */
pcm_export->Reset();
assert(period_buffer.IsEmpty());
assert(period_buffer.IsCleared());
ring_buffer->reset();
return;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment