Commit 3e517d07 authored by Richard Gobeille's avatar Richard Gobeille
Browse files

audiolib: shitcan lrintf use in sample calculation

parent 7e848127
......@@ -124,11 +124,11 @@ void AdLibDrv_MIDI_Service(void)
OPL3_GenerateResampled(AL_GetChip(), buf);
if (MV_Channels == 2)
{
*buffer16++ = clamp(lrintf(buf[0] * AL_PostAmp * AL_Volume * (1.f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
*buffer16++ = clamp(lrintf(buf[1] * AL_PostAmp * AL_Volume * (1.f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
*buffer16++ = clamp((buf[0] * AL_PostAmp * AL_Volume * (1.f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
*buffer16++ = clamp((buf[1] * AL_PostAmp * AL_Volume * (1.f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
}
else
*buffer16++ = clamp(lrintf((buf[0] + buf[1]) * AL_PostAmp * AL_Volume * (.5f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
*buffer16++ = clamp(((buf[0] + buf[1]) * AL_PostAmp * AL_Volume * (.5f / MIDI_MaxVolume)), INT16_MIN, INT16_MAX);
}
}
......
......@@ -203,7 +203,7 @@ void SF2Drv_MIDI_Service(void)
int const nsamples = samples * MV_Channels;
for (int j = 0; j < nsamples; j++)
*buffer16++ = clamp(Blrintf(fbuf[j] * fvolume), INT16_MIN, INT16_MAX);
*buffer16++ = clamp((fbuf[j] * fvolume), INT16_MIN, INT16_MAX);
if (MV_MIDIRenderTempo >= 0)
MV_MIDIRenderTimer += MV_MIDIRenderTempo * samples;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment