mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-11 05:11:33 +00:00
parent
1344059be4
commit
d313db553f
1 changed files with 10 additions and 1 deletions
|
@ -2942,7 +2942,16 @@ fluid_synth_render_blocks(fluid_synth_t* synth, int blockcount)
|
||||||
for (i=0; i < blockcount; i++) {
|
for (i=0; i < blockcount; i++) {
|
||||||
fluid_sample_timer_process(synth);
|
fluid_sample_timer_process(synth);
|
||||||
fluid_synth_add_ticks(synth, FLUID_BUFSIZE);
|
fluid_synth_add_ticks(synth, FLUID_BUFSIZE);
|
||||||
if (fluid_rvoice_eventhandler_dispatch_count(synth->eventhandler)) {
|
|
||||||
|
/* If events have been queued waiting for fluid_rvoice_eventhandler_dispatch_all()
|
||||||
|
* (should only happen with parallel render) OR we are about to process more
|
||||||
|
* blocks than we can store internally (being at risk having already dispatched many rvoices,
|
||||||
|
* because we may not be using parallel render), stop processing and go for rendering
|
||||||
|
*/
|
||||||
|
if (fluid_rvoice_eventhandler_dispatch_count(synth->eventhandler)
|
||||||
|
|| i+1 >= FLUID_MIXER_MAX_BUFFERS_DEFAULT-1 /* there actually is one 1 too many here,
|
||||||
|
but this seems to be the only way it works */
|
||||||
|
) {
|
||||||
// Something has happened, we can't process more
|
// Something has happened, we can't process more
|
||||||
blockcount = i+1;
|
blockcount = i+1;
|
||||||
break;
|
break;
|
||||||
|
|
Loading…
Reference in a new issue