mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-11-10 23:11:41 +00:00
always enforce enqueuing rvoice_events
This commit is contained in:
parent
1bb6210f91
commit
ef9564e000
2 changed files with 7 additions and 8 deletions
|
@ -233,7 +233,13 @@ new_fluid_rvoice_eventhandler(int is_threadsafe, int queuesize,
|
|||
eventhandler->mixer = NULL;
|
||||
eventhandler->queue = NULL;
|
||||
eventhandler->finished_voices = NULL;
|
||||
eventhandler->is_threadsafe = is_threadsafe;
|
||||
|
||||
/* HACK 2017-08-27: always enforce threadsafety, i.e. enforce enqueuing events
|
||||
* otherwise we mess up rendering if more than one block is requested by the user
|
||||
* because fluid_rvoice_eventhandler_dispatch_count() always stays zero causing
|
||||
* that too many events are dispatched too early, causing incorrectly timed audio
|
||||
*/
|
||||
eventhandler->is_threadsafe = TRUE;
|
||||
eventhandler->queue_stored = 0;
|
||||
|
||||
eventhandler->finished_voices = new_fluid_ringbuffer(finished_voices_size,
|
||||
|
|
|
@ -2939,17 +2939,10 @@ fluid_synth_render_blocks(fluid_synth_t* synth, int blockcount)
|
|||
|
||||
fluid_rvoice_eventhandler_dispatch_all(synth->eventhandler);
|
||||
|
||||
#if 0
|
||||
/* do not render more blocks than we can store internally */
|
||||
maxblocks = fluid_rvoice_mixer_get_bufcount(synth->eventhandler->mixer);
|
||||
if (blockcount > maxblocks)
|
||||
blockcount = maxblocks;
|
||||
#else
|
||||
/* if we process more blocks, noteons will be timed incorrectly
|
||||
* this bug seems to be design made, i.e. the current implementation requires to
|
||||
* process all events for one block and then render whatever we just processed. */
|
||||
blockcount = 1;
|
||||
#endif
|
||||
|
||||
for (i=0; i < blockcount; i++) {
|
||||
fluid_sample_timer_process(synth);
|
||||
|
|
Loading…
Reference in a new issue