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.
This commit is contained in:
Max Kellermann 2019-06-27 21:50:26 +02:00
parent 30ca6b8881
commit d66f5a8590
2 changed files with 7 additions and 3 deletions

View File

@ -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 {

View File

@ -857,7 +857,7 @@ AlsaOutput::Cancel() noexcept
synchronization */
pcm_export->Reset();
assert(period_buffer.IsEmpty());
assert(period_buffer.IsCleared());
ring_buffer->reset();
return;