During the drain period at the end of input the status of the alsa
buffer tree node is negative, yet we should not request a minimal
scheduler delay until the end of this period.
if (ret == 0)
return;
- if (ret < 0 || !pad)
+ if (!pad)
return sched_min_delay(s);
+ if (ret < 0)
+ return sched_request_barrier_or_min_delay(&pad->drain_barrier, s);
/*
* Data is available to be written to the alsa handle. Compute number
* of milliseconds until next buffer underrun would occur.