output/alsa: throw on snd_pcm_writei() error while draining
This implements real error handling, and avoids calling CancelInternal() from this code path.
This commit is contained in:
parent
7f143a83c1
commit
1a43f5145d
|
@ -727,9 +727,12 @@ AlsaOutput::DrainInternal()
|
||||||
/* drain period_buffer */
|
/* drain period_buffer */
|
||||||
if (!period_buffer.IsEmpty()) {
|
if (!period_buffer.IsEmpty()) {
|
||||||
auto frames_written = WriteFromPeriodBuffer();
|
auto frames_written = WriteFromPeriodBuffer();
|
||||||
if (frames_written < 0 && frames_written != -EAGAIN) {
|
if (frames_written < 0) {
|
||||||
CancelInternal();
|
if (frames_written == -EAGAIN)
|
||||||
return true;
|
return false;
|
||||||
|
|
||||||
|
throw FormatRuntimeError("snd_pcm_writei() failed: %s",
|
||||||
|
snd_strerror(-frames_written));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!period_buffer.IsEmpty())
|
if (!period_buffer.IsEmpty())
|
||||||
|
|
Loading…
Reference in New Issue