[FFmpeg-cvslog] af_aresample: fix rounding that led to sample accumulation in the buffers.

Michael Niedermayer git at videolan.org
Fri May 18 23:16:02 CEST 2012


ffmpeg | branch: master | Michael Niedermayer <michaelni at gmx.at> | Fri May 18 20:11:44 2012 +0200| [6ba692f8a7110c3960edb4b8e7a6736ee7124e2e] | committer: Michael Niedermayer

af_aresample: fix rounding that led to sample accumulation in the buffers.

This fixes a regression that apparently was missed when switching to the
in af resampler

Signed-off-by: Michael Niedermayer <michaelni at gmx.at>

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

 libavfilter/af_aresample.c |    2 +-
 tests/ref/acodec/g723_1    |    8 ++++----
 tests/ref/lavf/dv_fmt      |    6 +++---
 tests/ref/lavf/gxf         |    8 ++++----
 4 files changed, 12 insertions(+), 12 deletions(-)

diff --git a/libavfilter/af_aresample.c b/libavfilter/af_aresample.c
index a887684..91aee91 100644
--- a/libavfilter/af_aresample.c
+++ b/libavfilter/af_aresample.c
@@ -165,7 +165,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
 {
     AResampleContext *aresample = inlink->dst->priv;
     const int n_in  = insamplesref->audio->nb_samples;
-    int n_out       = n_in * aresample->ratio;
+    int n_out       = n_in * aresample->ratio + 1;
     AVFilterLink *const outlink = inlink->dst->outputs[0];
     AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
 
diff --git a/tests/ref/acodec/g723_1 b/tests/ref/acodec/g723_1
index 8ae11b8..2588f1e 100644
--- a/tests/ref/acodec/g723_1
+++ b/tests/ref/acodec/g723_1
@@ -1,4 +1,4 @@
-93fcff0367883ca8e75b3063c527a2ce *./tests/data/acodec/g723_1.tco
-4824 ./tests/data/acodec/g723_1.tco
-9f28820dc27cf207a15b2048789853cd *./tests/data/g723_1.acodec.out.wav
-stddev: 8502.50 PSNR: 17.74 MAXDIFF:26473 bytes:    96480/  1058400
+d34f35011a3d596eb359cc62c92fa737 *./tests/data/acodec/g723_1.tco
+4800 ./tests/data/acodec/g723_1.tco
+bc1807ce2a90997c09df66ced6900ebc *./tests/data/g723_1.acodec.out.wav
+stddev: 8507.27 PSNR: 17.73 MAXDIFF:26473 bytes:    96000/  1058400
diff --git a/tests/ref/lavf/dv_fmt b/tests/ref/lavf/dv_fmt
index 7661eb6..2a228b2 100644
--- a/tests/ref/lavf/dv_fmt
+++ b/tests/ref/lavf/dv_fmt
@@ -1,9 +1,9 @@
 6f9cfff48f536fa727696f2f9fb3ac08 *./tests/data/lavf/lavf.dv
 3600000 ./tests/data/lavf/lavf.dv
 ./tests/data/lavf/lavf.dv CRC=0x5ce4e5e4
-1ca94d11b585f80b25b90c6e9dae0f75 *./tests/data/lavf/lavf.dv
-3360000 ./tests/data/lavf/lavf.dv
-./tests/data/lavf/lavf.dv CRC=0x897791b1
+cc33ae4f9e6828914dea0f09d1241b7e *./tests/data/lavf/lavf.dv
+3480000 ./tests/data/lavf/lavf.dv
+./tests/data/lavf/lavf.dv CRC=0x8d5e9e8f
 87d3b20f656235671383a7eaa2f66330 *./tests/data/lavf/lavf.dv
 3600000 ./tests/data/lavf/lavf.dv
 ./tests/data/lavf/lavf.dv CRC=0x0e868a82
diff --git a/tests/ref/lavf/gxf b/tests/ref/lavf/gxf
index d16a706..63101b8 100644
--- a/tests/ref/lavf/gxf
+++ b/tests/ref/lavf/gxf
@@ -1,9 +1,9 @@
-480a13e0051adcf839ea392c91cb1e18 *./tests/data/lavf/lavf.gxf
+befc1a39c37a4ecd9264942a3e34b3f6 *./tests/data/lavf/lavf.gxf
 796392 ./tests/data/lavf/lavf.gxf
-./tests/data/lavf/lavf.gxf CRC=0x0052f91f
-89af7c3f7b7867bce1971123a9e03f4f *./tests/data/lavf/lavf.gxf
+./tests/data/lavf/lavf.gxf CRC=0x102918fd
+267d2b2b6e357209d76c366302cf35c3 *./tests/data/lavf/lavf.gxf
 794572 ./tests/data/lavf/lavf.gxf
-./tests/data/lavf/lavf.gxf CRC=0xe570b05e
+./tests/data/lavf/lavf.gxf CRC=0xab47d02d
 0a1a37fa79b62435545271b4e8e882f5 *./tests/data/lavf/lavf.gxf
 796392 ./tests/data/lavf/lavf.gxf
 ./tests/data/lavf/lavf.gxf CRC=0x3b1a8e91



More information about the ffmpeg-cvslog mailing list