aboutsummaryrefslogtreecommitdiff
path: root/backends/gp32
diff options
context:
space:
mode:
authorWon Star2006-06-29 05:34:56 +0000
committerWon Star2006-06-29 05:34:56 +0000
commit5e7d109e3cac8c46f3842df4988f082579de7ffa (patch)
tree05353f1bab7c95b3607c5676dc93c4cf659a7b7b /backends/gp32
parentd954c5ebd5af8390416dab9a1b885c445a4bba60 (diff)
downloadscummvm-rg350-5e7d109e3cac8c46f3842df4988f082579de7ffa.tar.gz
scummvm-rg350-5e7d109e3cac8c46f3842df4988f082579de7ffa.tar.bz2
scummvm-rg350-5e7d109e3cac8c46f3842df4988f082579de7ffa.zip
Lock sound timer thread.
svn-id: r23340
Diffstat (limited to 'backends/gp32')
-rw-r--r--backends/gp32/gp32std_sound.cpp10
1 files changed, 10 insertions, 0 deletions
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) {