Merge pull request #820 from FluidSynth/player-reset-between-songs

Reset synth after end, not before start of song
This commit is contained in:
Marcus Weseloh 2021-03-27 00:49:29 +01:00 committed by GitHub
commit 661a06b504
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 7 additions and 6 deletions

View file

@ -760,7 +760,7 @@ and commit the results. Refresh with the following command:
<type>bool</type>
<def>1 (TRUE)</def>
<realtime/>
<desc>If true, reset the synth before starting a new MIDI song, so the state of a previous song can't affect the new song. Turn it off for seamless looping of a song.</desc>
<desc>If true, reset the synth after the end of a MIDI song, so that the state of a previous song can't affect the next song. Turn it off for seamless looping of a song.</desc>
</setting>
<setting>
<name>timing-source</name>

View file

@ -2059,11 +2059,6 @@ fluid_player_playlist_load(fluid_player_t *player, unsigned int msec)
player->start_ticks = 0;
player->cur_ticks = 0;
if(player->reset_synth_between_songs)
{
fluid_synth_system_reset(player->synth);
}
for(i = 0; i < player->ntracks; i++)
{
if(player->track[i] != NULL)
@ -2145,6 +2140,12 @@ fluid_player_callback(void *data, unsigned int msec)
{
FLUID_LOG(FLUID_DBG, "%s: %d: Duration=%.3f sec", __FILE__,
__LINE__, (msec - player->begin_msec) / 1000.0);
if(player->reset_synth_between_songs)
{
fluid_synth_system_reset(player->synth);
}
loadnextfile = 1;
}