Call sample timers before processing block to get better latency

This commit is contained in:
David Henningsson 2009-06-07 08:10:09 +00:00
parent 22edb56803
commit 174ad10e1b
2 changed files with 4 additions and 5 deletions

View file

@ -1361,7 +1361,6 @@ int fluid_player_play(fluid_player_t* player)
if (player->sample_timer == NULL) { if (player->sample_timer == NULL) {
return FLUID_FAILED; return FLUID_FAILED;
} }
fluid_player_callback(player, 0); /* Process the first events before the first block */
} }
return FLUID_OK; return FLUID_OK;
} }

View file

@ -2012,6 +2012,10 @@ fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out)
fluid_check_fpe("??? Just starting up ???"); fluid_check_fpe("??? Just starting up ???");
fluid_sample_timer_process(synth);
fluid_check_fpe("fluid_sample_timer_process");
/* clean the audio buffers */ /* clean the audio buffers */
for (i = 0; i < synth->nbuf; i++) { for (i = 0; i < synth->nbuf; i++) {
FLUID_MEMSET(synth->left_buf[i], 0, byte_size); FLUID_MEMSET(synth->left_buf[i], 0, byte_size);
@ -2125,10 +2129,6 @@ fluid_synth_one_block(fluid_synth_t* synth, int do_not_mix_fx_to_out)
/* fluid_mutex_unlock(synth->busy); /\* Allow other threads to touch the synth *\/ */ /* fluid_mutex_unlock(synth->busy); /\* Allow other threads to touch the synth *\/ */
fluid_sample_timer_process(synth);
fluid_check_fpe("fluid_sample_timer_process");
return 0; return 0;
} }