mirror of
https://github.com/librespot-org/librespot.git
synced 2024-12-18 17:11:53 +00:00
Fix build on Rust < 1.50.0
This commit is contained in:
parent
f29e5212c4
commit
1672eb87ab
1 changed files with 8 additions and 3 deletions
|
@ -1263,11 +1263,16 @@ impl PlayerInternal {
|
|||
}
|
||||
}
|
||||
|
||||
*sample =
|
||||
(*sample as f64 * actual_normalisation_factor as f64) as f32;
|
||||
|
||||
// Extremely sharp attacks, however unlikely, *may* still clip and provide
|
||||
// undefined results, so strictly enforce output within [-1.0, 1.0].
|
||||
*sample = (*sample as f64 * actual_normalisation_factor as f64)
|
||||
.clamp(-1.0, 1.0)
|
||||
as f32;
|
||||
if *sample < -1.0 {
|
||||
*sample = -1.0;
|
||||
} else if *sample > 1.0 {
|
||||
*sample = 1.0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue