mirror of https://github.com/snes9xgit/snes9x.git
pulseaudio: Fix potential stall with Pipewire
Pipewire allows very small buffer sizes. It's possible that Snes9x will accumulate enough samples in fast-forward to exceed this. Instead of waiting forever for the buffer capacity to free up, just write the number of samples for the free space after one small wait.
This commit is contained in:
parent
a283596722
commit
34b6160805
|
@ -239,7 +239,7 @@ void S9xPulseSoundDriver::samples_available()
|
|||
|
||||
if (Settings.SoundSync && !Settings.TurboMode && !Settings.Mute)
|
||||
{
|
||||
while ((int)bytes < samples * 2)
|
||||
if ((int)bytes < samples * 2)
|
||||
{
|
||||
int usec_to_sleep = ((samples >> 1) - (bytes >> 2)) * 10000 /
|
||||
(Settings.SoundPlaybackRate / 100);
|
||||
|
|
Loading…
Reference in New Issue