# HG changeset patch # User iive # Date 1309818292 0 # Node ID 6c8743e5fa3019ab4089dfb788e06d336acf5859 # Parent 5e80ff193bc2976bb4d82543181d877c527d1c12 Audio format conversion from float to int is not checked for overflow. The float may be slightly off the [-1;1] range thus causing audible crackling noise. Add proper clipping using av_clip functions. Fixes bug 1919. diff -r 5e80ff193bc2 -r 6c8743e5fa30 libaf/af_format.c --- a/libaf/af_format.c Mon Jul 04 19:23:03 2011 +0000 +++ b/libaf/af_format.c Mon Jul 04 22:24:52 2011 +0000 @@ -32,6 +32,8 @@ #include "mpbswap.h" #include "libvo/fastmemcpy.h" +#include "libavutil/avutil.h" + /* Functions used by play to convert the input audio to the correct format */ @@ -474,23 +476,29 @@ static void float2int(float* in, void* out, int len, int bps) { + float f; register int i; switch(bps){ case(1): for(i=0;i