summaryrefslogtreecommitdiffstats
path: root/uisimulator
diff options
context:
space:
mode:
authorMiika Pekkarinen <miipekk@ihme.org>2006-07-31 15:02:39 +0000
committerMiika Pekkarinen <miipekk@ihme.org>2006-07-31 15:02:39 +0000
commit4222f6ce0d9bf19af0325d273b247127b6a3ef67 (patch)
treeeca87226ed43e1235fea948d98aa07be4082a20e /uisimulator
parent9b514409f3b1a41d4436167d0a9b0b69d8601ecd (diff)
downloadrockbox-4222f6ce0d9bf19af0325d273b247127b6a3ef67.tar.gz
rockbox-4222f6ce0d9bf19af0325d273b247127b6a3ef67.tar.bz2
rockbox-4222f6ce0d9bf19af0325d273b247127b6a3ef67.zip
Prevent the simulator SDL audio skipping under Linux.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@10383 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'uisimulator')
-rw-r--r--uisimulator/sdl/thread-sdl.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/uisimulator/sdl/thread-sdl.c b/uisimulator/sdl/thread-sdl.c
index 587a5cc868..9377ba5219 100644
--- a/uisimulator/sdl/thread-sdl.c
+++ b/uisimulator/sdl/thread-sdl.c
@@ -32,8 +32,14 @@ SDL_mutex *m;
void yield(void)
{
+ static int counter = 0;
+
SDL_mutexV(m);
- SDL_Delay(1);
+ if (counter++ >= 5)
+ {
+ SDL_Delay(1);
+ counter = 0;
+ }
SDL_mutexP(m);
}