input/alsa: handle EAGAIN

This commit is contained in:
Steven O'Brien 2017-01-13 21:04:05 +00:00 committed by Max Kellermann
parent 92684112ed
commit 144312a525
1 changed files with 3 additions and 0 deletions

View File

@ -222,6 +222,9 @@ AlsaInputStream::DispatchSockets()
snd_pcm_sframes_t n_frames;
while ((n_frames = snd_pcm_readi(capture_handle,
w.data, w_frames)) < 0) {
if (n_frames == -EAGAIN)
return;
if (Recover(n_frames) < 0) {
postponed_exception = std::make_exception_ptr(std::runtime_error("PCM error - stream aborted"));
cond.broadcast();