Commit f7ad7772 authored by David Reid's avatar David Reid

ALSA: Try making the handling of poll() a bit more robust.

Public issue https://github.com/mackron/miniaudio/issues/836.
parent 0eb86ea1
...@@ -28214,8 +28214,15 @@ static ma_result ma_device_wait__alsa(ma_device* pDevice, ma_snd_pcm_t* pPCM, st ...@@ -28214,8 +28214,15 @@ static ma_result ma_device_wait__alsa(ma_device* pDevice, ma_snd_pcm_t* pPCM, st
int resultALSA; int resultALSA;
int resultPoll = poll(pPollDescriptors, pollDescriptorCount, -1); int resultPoll = poll(pPollDescriptors, pollDescriptorCount, -1);
if (resultPoll < 0) { if (resultPoll < 0) {
ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_ERROR, "[ALSA] poll() failed.\n"); ma_log_post(ma_device_get_log(pDevice), MA_LOG_LEVEL_WARNING, "[ALSA] poll() failed.\n");
return ma_result_from_errno(errno);
/*
There have been reports that poll() is returning an error randomly and that instead of
returning an error, simply trying again will work. I'm experimenting with adopting this
advice.
*/
continue;
/*return ma_result_from_errno(errno);*/
} }
/* /*
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment