First post, by truth_deleted
With thread=off, the DOSBox-r3873-mt32 patch causes a dosbox error; it occurs after the mt32 emulated device is opened. However, thread=on does work.
Modified code which corrects the error:
--- midi_mt32.cpp 2014-12-01 23:07:00 -0500
+++ midi_mt32-NEW.cpp 2014-12-01 23:05:20 -0500
@@ -121,6 +121,13 @@ bool MidiHandler_mt32::Open(const char *
playedBuffers = 1;
thread = SDL_CreateThread(processingThread, NULL);
}
+ else {
+ sampleRateRatio = MT32Emu::SAMPLE_RATE / (double)synth->getStereoOutputSampleRate();
+ minimumRenderFrames = (MINIMUM_RENDER_MILLIS * synth->getStereoOutputSampleRate()) / MILLIS_PER_SECOND;
+ framesPerAudioBuffer = (AUDIO_LATENCY_MILLIS * synth->getStereoOutputSampleRate()) / MILLIS_PER_SECOND;
+ audioBufferSize = framesPerAudioBuffer << 1;
+ audioBuffer = new Bit16s[audioBufferSize];
+ }
chan->Enable(true);
open = true;
I don't know for sure whether the above added code is the proper solution, but nearly all these lines are required to avoid the above dosbox error where thread=off (same as renderInThread set to false in the code). The above lines are already available where thread=on (renderInThread = true).