diff --git a/src/drivers/fluid_jack.c b/src/drivers/fluid_jack.c index 18495dfe..ee61e3e3 100644 --- a/src/drivers/fluid_jack.c +++ b/src/drivers/fluid_jack.c @@ -750,6 +750,7 @@ fluid_jack_driver_process(jack_nframes_t nframes, void *arg) } else { + int res; fluid_audio_func_t callback = (audio_driver->callback != NULL) ? audio_driver->callback : (fluid_audio_func_t) fluid_synth_process; for(i = 0; i < audio_driver->num_output_ports; i++) @@ -776,12 +777,18 @@ fluid_jack_driver_process(jack_nframes_t nframes, void *arg) FLUID_MEMSET(audio_driver->fx_bufs[k], 0, nframes * sizeof(float)); } - return callback(audio_driver->data, + res = callback(audio_driver->data, nframes, audio_driver->num_fx_ports * 2, audio_driver->fx_bufs, audio_driver->num_output_ports * 2, audio_driver->output_bufs); + if(res != FLUID_OK) + { + const char *cb_func_name = (audio_driver->callback != NULL) ? "Custom audio callback function" : "fluid_synth_process()"; + FLUID_LOG(FLUID_PANIC, "%s returned an error. As a consequence, fluidsynth will now be removed from Jack's processing loop.", cb_func_name); + } + return res; } }