Commit 6ba692f8 authored by Michael Niedermayer's avatar 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: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent c0c2424f
...@@ -165,7 +165,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref ...@@ -165,7 +165,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
{ {
AResampleContext *aresample = inlink->dst->priv; AResampleContext *aresample = inlink->dst->priv;
const int n_in = insamplesref->audio->nb_samples; 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]; AVFilterLink *const outlink = inlink->dst->outputs[0];
AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out); AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);
......
93fcff0367883ca8e75b3063c527a2ce *./tests/data/acodec/g723_1.tco d34f35011a3d596eb359cc62c92fa737 *./tests/data/acodec/g723_1.tco
4824 ./tests/data/acodec/g723_1.tco 4800 ./tests/data/acodec/g723_1.tco
9f28820dc27cf207a15b2048789853cd *./tests/data/g723_1.acodec.out.wav bc1807ce2a90997c09df66ced6900ebc *./tests/data/g723_1.acodec.out.wav
stddev: 8502.50 PSNR: 17.74 MAXDIFF:26473 bytes: 96480/ 1058400 stddev: 8507.27 PSNR: 17.73 MAXDIFF:26473 bytes: 96000/ 1058400
6f9cfff48f536fa727696f2f9fb3ac08 *./tests/data/lavf/lavf.dv 6f9cfff48f536fa727696f2f9fb3ac08 *./tests/data/lavf/lavf.dv
3600000 ./tests/data/lavf/lavf.dv 3600000 ./tests/data/lavf/lavf.dv
./tests/data/lavf/lavf.dv CRC=0x5ce4e5e4 ./tests/data/lavf/lavf.dv CRC=0x5ce4e5e4
1ca94d11b585f80b25b90c6e9dae0f75 *./tests/data/lavf/lavf.dv cc33ae4f9e6828914dea0f09d1241b7e *./tests/data/lavf/lavf.dv
3360000 ./tests/data/lavf/lavf.dv 3480000 ./tests/data/lavf/lavf.dv
./tests/data/lavf/lavf.dv CRC=0x897791b1 ./tests/data/lavf/lavf.dv CRC=0x8d5e9e8f
87d3b20f656235671383a7eaa2f66330 *./tests/data/lavf/lavf.dv 87d3b20f656235671383a7eaa2f66330 *./tests/data/lavf/lavf.dv
3600000 ./tests/data/lavf/lavf.dv 3600000 ./tests/data/lavf/lavf.dv
./tests/data/lavf/lavf.dv CRC=0x0e868a82 ./tests/data/lavf/lavf.dv CRC=0x0e868a82
480a13e0051adcf839ea392c91cb1e18 *./tests/data/lavf/lavf.gxf befc1a39c37a4ecd9264942a3e34b3f6 *./tests/data/lavf/lavf.gxf
796392 ./tests/data/lavf/lavf.gxf 796392 ./tests/data/lavf/lavf.gxf
./tests/data/lavf/lavf.gxf CRC=0x0052f91f ./tests/data/lavf/lavf.gxf CRC=0x102918fd
89af7c3f7b7867bce1971123a9e03f4f *./tests/data/lavf/lavf.gxf 267d2b2b6e357209d76c366302cf35c3 *./tests/data/lavf/lavf.gxf
794572 ./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 0a1a37fa79b62435545271b4e8e882f5 *./tests/data/lavf/lavf.gxf
796392 ./tests/data/lavf/lavf.gxf 796392 ./tests/data/lavf/lavf.gxf
./tests/data/lavf/lavf.gxf CRC=0x3b1a8e91 ./tests/data/lavf/lavf.gxf CRC=0x3b1a8e91
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment