+ if (unlikely(s_chan->bFMod == 2))
+ {
+ // sucks, have to do double work
+ assert(!s_chan->bNoise);
+ d = do_samples_gauss(tmpFMod, decode_block, NULL, ch, ns_to,
+ &spu.sb[ch], s_chan->sinc, &s_chan->spos, &s_chan->iSBPos);
+ if (!s_chan->bStarting) {
+ d = MixADSR(tmpFMod, &s_chan->ADSRX, d);
+ if (d < ns_to) {
+ spu.dwChannelsAudible &= ~(1 << ch);
+ s_chan->ADSRX.State = ADSR_RELEASE;
+ s_chan->ADSRX.EnvelopeVol = 0;
+ }
+ }
+ memset(&tmpFMod[d], 0, (ns_to - d) * sizeof(tmpFMod[d]));
+ work->ch[ch].ns_to = d;
+ continue;
+ }
+ if (unlikely(s_chan->bFMod))
+ d = do_samples_skip_fmod(ch, ns_to, tmpFMod);
+ else
+ d = do_samples_skip(ch, ns_to);