From 72ce4242077f23b7de876b977397856bd072a6b1 Mon Sep 17 00:00:00 2001 From: Simon Howard Date: Sun, 11 May 2014 00:14:04 -0400 Subject: 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. --- opl/examples/droplay.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'opl/examples/droplay.c') 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); -- cgit v1.2.3