wasapi: correctly render effects if no custom audio processing is used.

I couldn't find a conceivable use case for calling `new_fluid_audio_driver2`
with `fluid_synth_process` as its callback in client code... So I took the
lazy route.

If custom audio processing is indeed used, nothing would be changed by this
patch. It still gets no effects buffer (like the vast majority of other
drivers).
This commit is contained in:
Chris Xiong 2021-04-16 18:34:11 +08:00
parent 0d627c7c0b
commit 5eff4e592e

View file

@ -635,6 +635,8 @@ static int fluid_wasapi_write_processed_channels(void *data, int len,
fluid_wasapi_audio_driver_t *drv = (fluid_wasapi_audio_driver_t *) data;
float *optr[FLUID_WASAPI_MAX_OUTPUTS * 2];
int16_t *ioptr[FLUID_WASAPI_MAX_OUTPUTS * 2];
int efx_nch = 0;
float **efx_buf = NULL;
for(ch = 0; ch < drv->channels_count; ++ch)
{
@ -643,7 +645,12 @@ static int fluid_wasapi_write_processed_channels(void *data, int len,
ioptr[ch] = (int16_t *)channels_out[ch] + channels_off[ch];
}
ret = drv->func(drv->user_pointer, len, 0, NULL, drv->channels_count, drv->drybuf);
if(drv->func == (fluid_audio_func_t)fluid_synth_process)
{
efx_nch = drv->channels_count;
efx_buf = drv->drybuf;
}
ret = drv->func(drv->user_pointer, len, efx_nch, efx_buf, drv->channels_count, drv->drybuf);
for(ch = 0; ch < drv->channels_count; ++ch)
{