Fixup error checking in ALSA.

This commit is contained in:
Themaister 2012-09-14 21:41:58 +02:00
parent 5a4c51a5cb
commit d4712d97c9

View File

@ -158,7 +158,7 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
break;
}
else if (frames == -EAGAIN && alsa->nonblock)
else if (frames == -EAGAIN && !alsa->nonblock) // Definitely not supposed to happen.
{
RARCH_WARN("[ALSA]: poll() was signaled, but EAGAIN returned from write.\n"
"Your ALSA driver might be subtly broken.\n");
@ -171,6 +171,10 @@ static ssize_t alsa_write(void *data, const void *buf_, size_t size_)
else
return written;
}
else if (frames == -EAGAIN) // Expected if we're running nonblock.
{
return written;
}
else if (frames < 0)
{
RARCH_ERR("[ALSA]: Unknown error occured (%s).\n", snd_strerror(frames));