Fixed glitch in sound buffer space calculation

Sometimes the sound buffer (ALSA) returns a few more samples than we
sent to it. In this case we return 0, which means that no data has
to be sent.
This commit is contained in:
Andreas Eversberg
2022-06-02 20:26:45 +02:00
parent ba4c095d09
commit 98ed54124a

View File

@@ -515,6 +515,8 @@ int sound_get_tosend(void *inst, int buffer_size)
}
tosend = buffer_size - delay;
if (tosend < 0)
tosend = 0;
return tosend;
}