From 0fff1380b18f4f695d0481fd0cb0e19e1991140a Mon Sep 17 00:00:00 2001 From: Rudolf Polzer Date: Tue, 3 May 2011 22:11:53 +0200 Subject: audio: clamp sample values in float->int format conversions Make af_format clamp float sample values to the range [-1, 1] before conversion to integer types. Before any out-of-range values wrapped around and caused nasty artifacts. This filter is used for all automatic format conversions; thus any decoder that outputs floats with possible out-of-range values would have been affected by the bad conversion if its output needed to be converted to integers for AO. --- libaf/af_format.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'libaf/af_format.c') diff --git a/libaf/af_format.c b/libaf/af_format.c index 3b9b907882..729b964726 100644 --- a/libaf/af_format.c +++ b/libaf/af_format.c @@ -478,19 +478,19 @@ static void float2int(float* in, void* out, int len, int bps) switch(bps){ case(1): for(i=0;i