mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-02 17:12:15 +00:00
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:
parent
0d627c7c0b
commit
5eff4e592e
1 changed files with 8 additions and 1 deletions
|
@ -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)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue