This commit is contained in:
Pierre Krieger 2015-03-25 11:21:10 +01:00
parent f7c2949549
commit 84326cb4a7
6 changed files with 12 additions and 14 deletions

View file

@ -83,7 +83,7 @@ impl Sample for i16 {
fn to_vec_u16(input: &[i16]) -> Cow<[u16]> {
Cow::Owned(input.iter().map(|&value| {
if value < 0 {
(value + 32767) as u16 + 1
(value + 32767 + 1) as u16
} else {
(value as u16) + 32768
}