lavfi/earwax: clip sample, this is what sox does
authorPaul B Mahol <onemda@gmail.com>
Wed, 3 Apr 2013 10:52:01 +0000 (10:52 +0000)
committerPaul B Mahol <onemda@gmail.com>
Wed, 3 Apr 2013 10:55:13 +0000 (10:55 +0000)
Fixes #1884.

Signed-off-by: Paul B Mahol <onemda@gmail.com>
libavfilter/af_earwax.c

index b1d3d6f..104fb18 100644 (file)
@@ -98,10 +98,10 @@ static inline int16_t *scalarproduct(const int16_t *in, const int16_t *endin, in
     int16_t j;
 
     while (in < endin) {
-        sample = 32;
+        sample = 0;
         for (j = 0; j < NUMTAPS; j++)
             sample += in[j] * filt[j];
-        *out = sample >> 6;
+        *out = av_clip_int16(sample >> 6);
         out++;
         in++;
     }