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.
This commit is contained in:
Wohlstand 2020-10-11 01:44:20 +03:00 committed by Christoph Oelckers
parent 8c9f402c31
commit 8eff49f731
2 changed files with 2 additions and 2 deletions

View file

@ -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)
{

View file

@ -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)
{