mirror of
https://github.com/ZDoom/fluidsynth.git
synced 2025-04-22 15:42:54 +00:00
Optimize fluid_voice_get_lower_boundary_for_attenuation()
- Same result as befor but a bit faster.
This commit is contained in:
parent
0de4ac4216
commit
c2bff2032a
1 changed files with 13 additions and 9 deletions
|
@ -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 */
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue