diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2012-05-18 22:11:44 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2012-05-19 00:57:02 +0400 |
commit | 6ba692f8a7110c3960edb4b8e7a6736ee7124e2e (patch) | |
tree | 893a69eb97e2be8f7c5d44ff08894c8baff8ba57 | |
parent | c0c2424f737fc5c7f0056751f5d8126b991bfe5d (diff) |
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@gmx.at>
-rw-r--r-- | libavfilter/af_aresample.c | 2 | ||||
-rw-r--r-- | tests/ref/acodec/g723_1 | 8 | ||||
-rw-r--r-- | tests/ref/lavf/dv_fmt | 6 | ||||
-rw-r--r-- | 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 a88768496d..91aee91af2 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 8ae11b8504..2588f1e0da 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 7661eb6d98..2a228b20b9 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 d16a706f66..63101b89ed 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 |