output/alsa: DrainInternal() ignores postponed partial frame
This commit is contained in:
parent
c1eb0583c4
commit
f0ac63d5af
@ -81,6 +81,17 @@ public:
|
||||
return head > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Has all data for the current period been drained? If not,
|
||||
* then there is pending data. This ignores the partial frame
|
||||
* which may have been postponed by FillWithSilence().
|
||||
*/
|
||||
bool IsDrained() const noexcept {
|
||||
/* compare head with capacity, not with tail; this
|
||||
method makes only sense if the period is full */
|
||||
return head >= capacity;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the tail of the buffer, i.e. where new data can be
|
||||
* written. Call GetSpaceBytes() to find out how much may be
|
||||
|
@ -753,7 +753,7 @@ AlsaOutput::DrainInternal()
|
||||
period_buffer.FillWithSilence(silence, out_frame_size);
|
||||
|
||||
/* drain period_buffer */
|
||||
if (!period_buffer.IsEmpty()) {
|
||||
if (!period_buffer.IsDrained()) {
|
||||
auto frames_written = WriteFromPeriodBuffer();
|
||||
if (frames_written < 0) {
|
||||
if (frames_written == -EAGAIN)
|
||||
|
Loading…
Reference in New Issue
Block a user