mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2024-12-01 00:21:14 +00:00
Call sample timers before processing block to get better latency
This commit is contained in:
parent
22edb56803
commit
174ad10e1b
2 changed files with 4 additions and 5 deletions
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
|
@ -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;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue