LibAudio: Use clamp() in Sample::clip()

Sample::clip() now uses clamp().
This commit is contained in:
mkblumenau 2024-07-04 23:41:47 -04:00 committed by Nico Weber
parent e89726562b
commit eb1e054d65

View file

@ -53,15 +53,8 @@ struct Sample {
void clip()
{
if (left > 1)
left = 1;
else if (left < -1)
left = -1;
if (right > 1)
right = 1;
else if (right < -1)
right = -1;
left = clamp(left, -1, 1);
right = clamp(right, -1, 1);
}
// Logarithmic scaling, as audio should ALWAYS do.