Skip to content

Commit

Permalink
Fix a regression introduced by #1314 (#1381)
Browse files Browse the repository at this point in the history
  • Loading branch information
derselbst authored Sep 19, 2024
1 parent d51ae6b commit 40ede9d
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/rvoice/fluid_rvoice.c
Original file line number Diff line number Diff line change
Expand Up @@ -354,6 +354,12 @@ fluid_rvoice_write(fluid_rvoice_t *voice, fluid_real_t *dsp_buf)
/******************* amplitude **********************/

count = fluid_rvoice_calc_amp(voice);
if(count == 0)
{
// Voice has finished, remove from dsp loop
return 0;
}
// else if count is negative, still process the voice


/******************* phase **********************/
Expand Down Expand Up @@ -427,7 +433,7 @@ fluid_rvoice_write(fluid_rvoice_t *voice, fluid_real_t *dsp_buf)
* Depending on the position in the loop and the loop size, this
* may require several runs. */

if(count <= 0)
if(count < 0)
{
// The voice is quite, i.e. either in delay phase or zero volume.
// We need to update the rvoice's dsp phase, as the delay phase shall not "postpone" the sound, rather
Expand Down

0 comments on commit 40ede9d

Please sign in to comment.