Optimize fluid_voice_get_lower_boundary_for_attenuation()

- Same result as befor but a bit faster.
This commit is contained in:
jjceresa 2019-10-08 20:12:50 +02:00
parent 0de4ac4216
commit c2bff2032a

View file

@ -1909,17 +1909,10 @@ fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t *voice)
/* min_val,max_val for src2 unipolar and amount > 0 */
min_val *= link_min_max[j].min;
max_val *= link_min_max[j].max ;
/* permutes min and max when amount is < 0 */
if(modj->amount < 0)
{
temp = min_val;
min_val = max_val;
max_val = temp;
}
/* for src2 bipolar, max min are adjusted to
the same value: maximum(min,max) */
if(modj->flags2 & FLUID_MOD_BIPOLAR)
{
/* for src2 bipolar, max min are adjusted to
the same value: maximum(min,max) */
if(min_val > max_val)
{
max_val = min_val;
@ -1929,6 +1922,17 @@ fluid_voice_get_lower_boundary_for_attenuation(fluid_voice_t *voice)
min_val = max_val;
}
}
else
{
/* for src2 unipolar permutes min and max when
amount is < 0 */
if(modj->amount < 0)
{
temp = min_val;
min_val = max_val;
max_val = temp;
}
}
}
else /* src1 is not linked */
{