From aa8a32951ab63bece2ac400150bdd5d29df31476 Mon Sep 17 00:00:00 2001 From: loki666 Date: Sun, 5 Nov 2017 18:02:03 +0100 Subject: [PATCH] avoid hanging notes --- src/midi/fluid_midi.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/midi/fluid_midi.c b/src/midi/fluid_midi.c index c36ed7e0..272df604 100644 --- a/src/midi/fluid_midi.c +++ b/src/midi/fluid_midi.c @@ -1636,6 +1636,10 @@ fluid_player_callback(void *data, unsigned int msec) + (int) ((double) (player->cur_msec - player->start_msec) / player->deltatime + 0.5)); /* 0.5 to average overall error when casting */ + if (player->seek_ticks >= 0) { + fluid_synth_all_sounds_off(synth, -1); /* avoid hanging notes */ + } + for (i = 0; i < player->ntracks; i++) { if (!fluid_track_eot(player->track[i])) { status = FLUID_PLAYER_PLAYING;