From 5e7d109e3cac8c46f3842df4988f082579de7ffa Mon Sep 17 00:00:00 2001 From: Won Star Date: Thu, 29 Jun 2006 05:34:56 +0000 Subject: Lock sound timer thread. svn-id: r23340 --- backends/gp32/gp32std_sound.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'backends/gp32') diff --git a/backends/gp32/gp32std_sound.cpp b/backends/gp32/gp32std_sound.cpp index 711a101fc8..56335f1c4f 100644 --- a/backends/gp32/gp32std_sound.cpp +++ b/backends/gp32/gp32std_sound.cpp @@ -43,6 +43,14 @@ static GPSOUNDBUF soundBuf; // polls the current playing position within the buffer. static void soundTimer() { + static int locked = false; + + if (locked) { + return; + } + + locked = true; + unsigned int sampleshiftVal = soundBuf.samples << shiftVal; unsigned int t = (((unsigned int)(*soundPos) - (unsigned int)buffer) >> shiftVal) >= soundBuf.samples ? 1 : 0; if (t != frame) { @@ -90,6 +98,8 @@ static void soundTimer() { } while ((uint32)d < max); } } + + locked = false; } int gp_soundBufStart(GPSOUNDBUF *sb) { -- cgit v1.2.3