# HG changeset patch # User Matti Hamalainen # Date 1274666853 -10800 # Node ID 093315d84a220ad9e5b2be69a5a1e8e56c7f9865 # Parent 423ff2a1101879d197a14d1d41041d8006fb0591 Add a small delay in SDL audio pseudo-loopflush function to avoid tightlooping in prod main loops (explained better in the added comment.) diff -r 423ff2a11018 -r 093315d84a22 pwplib/snd-sdl.c --- a/pwplib/snd-sdl.c Mon May 24 03:49:06 2010 +0300 +++ b/pwplib/snd-sdl.c Mon May 24 05:07:33 2010 +0300 @@ -50,6 +50,15 @@ pwplib.player(); SDL_PauseAudio(0); } + + /* NOTICE! A small delay is used here, because the prods using pwplib + * run in a tight loop (they expect that audio rendering blocks, + * which it doesn't in case of SDL.) This way we avoid consuming + * excessive amounts of CPU. + * + * -- ccr + */ + SDL_Delay(10); } int pwp_sdlaudio_init()