aboutsummaryrefslogtreecommitdiff
path: root/backends/gp32
diff options
context:
space:
mode:
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) {