rpcsx-os: alsa: avoid recursion

This commit is contained in:
DH 2024-10-04 16:53:55 +03:00
parent ff297652e7
commit 21d67947dd

View file

@ -248,20 +248,21 @@ long AlsaDevice::write(void *buf, long len) {
while (true) {
snd_pcm_sframes_t r = snd_pcm_writei(mPCMHandle, buf, frames);
if (r == -EPIPE) {
if (fixXRun() == 0) {
return write(buf, len);
}
continue;
if (r == -EPIPE) {
r = fixXRun();
if (r == 0) {
continue;
}
}
if (r == -ESTRPIPE) {
if (resume() == 0) {
return write(buf, len);
}
r = resume();
continue;
if (r == 0) {
continue;
}
}
if (r < 0) {