mirror of
https://github.com/libretro/scummvm.git
synced 2024-12-21 01:08:25 +00:00
Lock sound timer thread.
svn-id: r23340
This commit is contained in:
parent
d954c5ebd5
commit
5e7d109e3c
@ -43,6 +43,14 @@ static GPSOUNDBUF soundBuf;
|
|||||||
// polls the current playing position within the buffer.
|
// polls the current playing position within the buffer.
|
||||||
|
|
||||||
static void soundTimer() {
|
static void soundTimer() {
|
||||||
|
static int locked = false;
|
||||||
|
|
||||||
|
if (locked) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
locked = true;
|
||||||
|
|
||||||
unsigned int sampleshiftVal = soundBuf.samples << shiftVal;
|
unsigned int sampleshiftVal = soundBuf.samples << shiftVal;
|
||||||
unsigned int t = (((unsigned int)(*soundPos) - (unsigned int)buffer) >> shiftVal) >= soundBuf.samples ? 1 : 0;
|
unsigned int t = (((unsigned int)(*soundPos) - (unsigned int)buffer) >> shiftVal) >= soundBuf.samples ? 1 : 0;
|
||||||
if (t != frame) {
|
if (t != frame) {
|
||||||
@ -90,6 +98,8 @@ static void soundTimer() {
|
|||||||
} while ((uint32)d < max);
|
} while ((uint32)d < max);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
locked = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
int gp_soundBufStart(GPSOUNDBUF *sb) {
|
int gp_soundBufStart(GPSOUNDBUF *sb) {
|
||||||
|
Loading…
Reference in New Issue
Block a user