- added a band-aid fix in case Timidity has both chorus and reverb active.

This merely addresses the crashing issue, it does nothing about the faulty initialization logic here that causes the chorus not to get initialized properly if reverb is active.
The issue needs more in-detail investigation but for now this has to suffice.
This commit is contained in:
Christoph Oelckers 2018-03-25 12:12:14 +02:00
parent 4c4f8288a4
commit c0893027da
2 changed files with 9 additions and 1 deletions

View File

@ -131,11 +131,11 @@ CUSTOM_CVAR(Int, timidity_chorus, 0, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
CUSTOM_CVAR(Bool, timidity_surround_chorus, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)
{
ChangeVarSync(TimidityPlus::timidity_surround_chorus, *self);
if (currSong != nullptr && currSong->GetDeviceType() == MDEV_TIMIDITY)
{
MIDIDeviceChanged(-1, true);
}
ChangeVarSync(TimidityPlus::timidity_surround_chorus, *self);
}
CUSTOM_CVAR(Bool, timidity_channel_pressure, false, CVAR_ARCHIVE | CVAR_GLOBALCONFIG)

View File

@ -1878,6 +1878,14 @@ void Reverb::do_ch_stereo_chorus(int32_t *buf, int32_t count, InfoStereoChorus *
return;
}
if (bufL == nullptr)
{
set_delay(&(info->delayL), info->rpt0);
set_delay(&(info->delayR), info->rpt0);
bufL = info->delayL.buf;
bufR = info->delayR.buf;
}
/* LFO */
f0 = imuldiv24(lfobufL[imuldiv24(lfocnt, icycle)], depth);
spt0 = wpt0 - pdelay - (f0 >> 8); /* integral part of delay */