summaryrefslogtreecommitdiff
path: root/opl/examples/droplay.c
diff options
context:
space:
mode:
authorSimon Howard2014-05-11 00:14:04 -0400
committerSimon Howard2014-05-11 00:14:04 -0400
commit72ce4242077f23b7de876b977397856bd072a6b1 (patch)
tree1002b8eb4f15d16564a1acadfcd04a264cde558d /opl/examples/droplay.c
parent495694da29ff736fba2fdc696553ee7197247174 (diff)
downloadchocolate-doom-72ce4242077f23b7de876b977397856bd072a6b1.tar.gz
chocolate-doom-72ce4242077f23b7de876b977397856bd072a6b1.tar.bz2
chocolate-doom-72ce4242077f23b7de876b977397856bd072a6b1.zip
opl: Change library to use us instead of ms.
Multi-track MIDI files are played back using separate callback chains for each track, and this introduces the possibility of one track becoming out of sync with the others. This was noticeable in WADs that use multi-track MIDIs, such as Alien Vendetta. Increase the timing resolution to microsecond precision to fix this.
Diffstat (limited to 'opl/examples/droplay.c')
-rw-r--r--opl/examples/droplay.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/opl/examples/droplay.c b/opl/examples/droplay.c
index 99456050..7b20e03d 100644
--- a/opl/examples/droplay.c
+++ b/opl/examples/droplay.c
@@ -139,7 +139,7 @@ void TimerCallback(void *data)
// Schedule the next timer callback.
- OPL_SetCallback(delay, TimerCallback, timer_data);
+ OPL_SetCallback(delay * OPL_MS, TimerCallback, timer_data);
}
void PlayFile(char *filename)
@@ -183,7 +183,7 @@ void PlayFile(char *filename)
running = timer_data.running;
OPL_Unlock();
- SDL_Delay(100);
+ SDL_Delay(100 * OPL_MS);
} while (running);
fclose(timer_data.fstream);