swr/resample: fix filter rounding and cliping for s32
authorMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Feb 2013 02:25:07 +0000 (03:25 +0100)
committerMichael Niedermayer <michaelni@gmx.at>
Mon, 4 Feb 2013 03:05:59 +0000 (04:05 +0100)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libswresample/resample.c

index d3fe1a7..fb9da7c 100644 (file)
@@ -142,7 +142,7 @@ static int build_filter(ResampleContext *c, void *filter, double factor, int tap
             break;
         case AV_SAMPLE_FMT_S32P:
             for(i=0;i<tap_count;i++)
-                ((int32_t*)filter)[ph * alloc + i] = av_clip(lrintf(tab[i] * scale / norm), INT32_MIN, INT32_MAX);
+                ((int32_t*)filter)[ph * alloc + i] = av_clipl_int32(llrint(tab[i] * scale / norm));
             break;
         case AV_SAMPLE_FMT_FLTP:
             for(i=0;i<tap_count;i++)