Module: wine Branch: master Commit: 998e5a0432b10fe88452baebba249efb1471d968 URL: http://source.winehq.org/git/wine.git/?a=commit;h=998e5a0432b10fe88452baebba...
Author: Andrew Eikum aeikum@codeweavers.com Date: Wed Oct 21 10:01:22 2015 -0500
xaudio2: Don't render less than a period of audio.
Sometimes the ALSA driver will report a very small amount of frames available after a period signal. There is a bug in OpenAL 1.15 which will crash the application if alcRenderSamplesSOFT is called with less than 4 frames. And anyway, we shouldn't incur all of this overhead just to render a couple of frames. So, just skip the rendering step if we have less than a period of space available in the driver.
Signed-off-by: Andrew Eikum aeikum@codeweavers.com Signed-off-by: Alexandre Julliard julliard@winehq.org
---
dlls/xaudio2_7/xaudio_dll.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/xaudio2_7/xaudio_dll.c b/dlls/xaudio2_7/xaudio_dll.c index 76b4c13..a4a9399 100644 --- a/dlls/xaudio2_7/xaudio_dll.c +++ b/dlls/xaudio2_7/xaudio_dll.c @@ -2723,7 +2723,11 @@ static void do_engine_tick(IXAudio2Impl *This) }
nframes = This->period_frames * 3 - pad; - TRACE("going to render %u frames\n", nframes); + + TRACE("frames available: %u\n", nframes); + + if(nframes < This->period_frames) + return;
if(!nframes) return;