From 377ab9db2f87bc407eeb940e0361edc77da77055 Mon Sep 17 00:00:00 2001 From: Bill Peterson Date: Sun, 24 Sep 2023 04:39:03 -0500 Subject: [PATCH] Fix player termination after stopping and restarting (#1273) If using the sample timer, reset cur_msec=0 in fluid_player_play() since the sample timer is also reset. This way fluid_player_callback() will not misinterpret the player's cur_msec < msec as being due to a fluid_synth_get_ticks overflow. --- src/midi/fluid_midi.c | 1 + 1 file changed, 1 insertion(+) diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index 5df704a20..10561d216 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -2291,6 +2291,7 @@ fluid_player_play(fluid_player_t *player) if(!player->use_system_timer) { fluid_sample_timer_reset(player->synth, player->sample_timer); + player->cur_msec = 0; } /* If we're at the end of the playlist and there are no loops left, loop once */