From 8eff49f73124aef57ba58207240d8d298e52c0da Mon Sep 17 00:00:00 2001 From: Wohlstand Date: Sun, 11 Oct 2020 01:44:20 +0300 Subject: [PATCH] libADLMIDI & libOPNMIDI: Apply the important fix Fixed an incorrect timer processing when using a real-time interface. This bug does directly affect the case of ZMusic which does use of RealTime API of both libraries. --- thirdparty/adlmidi/adlmidi.cpp | 2 +- thirdparty/opnmidi/opnmidi.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/thirdparty/adlmidi/adlmidi.cpp b/thirdparty/adlmidi/adlmidi.cpp index 9d33e62..6b28e06 100644 --- a/thirdparty/adlmidi/adlmidi.cpp +++ b/thirdparty/adlmidi/adlmidi.cpp @@ -1414,7 +1414,7 @@ ADLMIDI_EXPORT int adl_generateFormat(struct ADL_MIDIPlayer *device, int sampleC ssize_t n_periodCountStereo = 512; int left = sampleCount; - double delay = double(sampleCount) / double(setup.PCM_RATE); + double delay = double(sampleCount / 2) / double(setup.PCM_RATE); while(left > 0) { diff --git a/thirdparty/opnmidi/opnmidi.cpp b/thirdparty/opnmidi/opnmidi.cpp index c5cf140..49c71e0 100644 --- a/thirdparty/opnmidi/opnmidi.cpp +++ b/thirdparty/opnmidi/opnmidi.cpp @@ -1134,7 +1134,7 @@ OPNMIDI_EXPORT int opn2_generateFormat(struct OPN2_MIDIPlayer *device, int sampl ssize_t n_periodCountStereo = 512; int left = sampleCount; - double delay = double(sampleCount) / double(setup.PCM_RATE); + double delay = double(sampleCount / 2) / double(setup.PCM_RATE); while(left > 0) {