mirror of
https://github.com/SerenityOS/serenity
synced 2024-11-05 17:46:52 +00:00
LibAudio: Use clamp() in Sample::clip()
Sample::clip() now uses clamp().
This commit is contained in:
parent
e89726562b
commit
eb1e054d65
1 changed files with 2 additions and 9 deletions
|
@ -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.
|
||||
|
|
Loading…
Reference in a new issue