diff options
author | Luca Barbato <lu_zero@gentoo.org> | 2014-05-26 21:30:30 +0200 |
---|---|---|
committer | Luca Barbato <lu_zero@gentoo.org> | 2014-05-28 22:50:55 +0200 |
commit | ad0fe2f4012031c47268f14b9835088c488e1998 (patch) | |
tree | 49502265ef50caf8aceb805b0a102c57a020082c /libavfilter | |
parent | b2d45654220503224aa94e78cdff19ec624e9342 (diff) | |
download | ffmpeg-ad0fe2f4012031c47268f14b9835088c488e1998.tar.gz |
af_resample: Use avresample_get_out_samples
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/af_resample.c | 9 |
1 files changed, 2 insertions, 7 deletions
diff --git a/libavfilter/af_resample.c b/libavfilter/af_resample.c index a89ab35e5c..bc8fd8a731 100644 --- a/libavfilter/af_resample.c +++ b/libavfilter/af_resample.c @@ -180,10 +180,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; @@ -219,9 +216,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) { |