aboutsummaryrefslogtreecommitdiffstats
path: root/libavfilter/af_resample.c
diff options
context:
space:
mode:
authorMichael Niedermayer <michaelni@gmx.at>2014-05-29 01:24:26 +0200
committerMichael Niedermayer <michaelni@gmx.at>2014-05-29 01:24:48 +0200
commit20343cfb51ea234500ce9c9c39b79287f44de4f7 (patch)
tree2302b11983f7124e033685168714b9c65773b49f /libavfilter/af_resample.c
parentbdb2e80e88e76cc39c6d85a8f1c1712d36e18966 (diff)
parentad0fe2f4012031c47268f14b9835088c488e1998 (diff)
downloadffmpeg-20343cfb51ea234500ce9c9c39b79287f44de4f7.tar.gz
Merge commit 'ad0fe2f4012031c47268f14b9835088c488e1998'
* commit 'ad0fe2f4012031c47268f14b9835088c488e1998': af_resample: Use avresample_get_out_samples Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavfilter/af_resample.c')
-rw-r--r--libavfilter/af_resample.c9
1 files changed, 2 insertions, 7 deletions
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c
index 9d1b1c4567..03467a747b 100644
--- a/libavfilter/af_resample.c
+++ b/libavfilter/af_resample.c
@@ -179,10 +179,7 @@ static int request_frame(AVFilterLink *outlink)
/* flush the lavr delay buffer */
if (ret == AVERROR_EOF && s->avr) {
AVFrame *frame;
- int nb_samples = av_rescale_rnd(avresample_get_delay(s->avr),
- outlink->sample_rate,
- ctx->inputs[0]->sample_rate,
- AV_ROUND_UP);
+ int nb_samples = avresample_get_out_samples(s->avr, 0);
if (!nb_samples)
return ret;
@@ -218,9 +215,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
/* maximum possible samples lavr can output */
delay = avresample_get_delay(s->avr);
- nb_samples = av_rescale_rnd(in->nb_samples + delay,
- outlink->sample_rate, inlink->sample_rate,
- AV_ROUND_UP);
+ nb_samples = avresample_get_out_samples(s->avr, in->nb_samples);
out = ff_get_audio_buffer(outlink, nb_samples);
if (!out) {