[FFmpeg-cvslog] avfilter/avf_showfreqs: Use floating point division in WFUNC_BHANN

Michael Niedermayer git at videolan.org
Thu Sep 3 19:24:22 CEST 2015


ffmpeg | branch: master | Michael Niedermayer <michael at niedermayer.cc> | Thu Sep  3 14:39:08 2015 +0200| [629fcda4dace5e817f5d407453774b2dc295c0e8] | committer: Michael Niedermayer

avfilter/avf_showfreqs: Use floating point division in WFUNC_BHANN

Fixes: CID1322365

Reviewed-by: Paul B Mahol <onemda at gmail.com>
Signed-off-by: Michael Niedermayer <michael at niedermayer.cc>

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=629fcda4dace5e817f5d407453774b2dc295c0e8
---

 libavfilter/avf_showfreqs.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/libavfilter/avf_showfreqs.c b/libavfilter/avf_showfreqs.c
index a1ef0bf..cbbf040 100644
--- a/libavfilter/avf_showfreqs.c
+++ b/libavfilter/avf_showfreqs.c
@@ -208,7 +208,7 @@ static void generate_window_func(float *lut, int N, int win_func, float *overlap
         break;
     case WFUNC_BHANN:
         for (n = 0; n < N; n++)
-            lut[n] = 0.62-0.48*FFABS(n/(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
+            lut[n] = 0.62-0.48*FFABS(n/(double)(N-1)-.5)-0.38*cos(2*M_PI*n/(N-1));
         *overlap = 0.5;
         break;
     case WFUNC_SINE:



More information about the ffmpeg-cvslog mailing list