Merge commit 'ad0fe2f401
'
* commit 'ad0fe2f401
':
af_resample: Use avresample_get_out_samples
Merged-by: Michael Niedermayer <michaelni@gmx.at>
This commit is contained in:
commit
20343cfb51
1 changed files with 2 additions and 7 deletions
|
@ -179,10 +179,7 @@ static int request_frame(AVFilterLink *outlink)
|
||||||
/* flush the lavr delay buffer */
|
/* flush the lavr delay buffer */
|
||||||
if (ret == AVERROR_EOF && s->avr) {
|
if (ret == AVERROR_EOF && s->avr) {
|
||||||
AVFrame *frame;
|
AVFrame *frame;
|
||||||
int nb_samples = av_rescale_rnd(avresample_get_delay(s->avr),
|
int nb_samples = avresample_get_out_samples(s->avr, 0);
|
||||||
outlink->sample_rate,
|
|
||||||
ctx->inputs[0]->sample_rate,
|
|
||||||
AV_ROUND_UP);
|
|
||||||
|
|
||||||
if (!nb_samples)
|
if (!nb_samples)
|
||||||
return ret;
|
return ret;
|
||||||
|
@ -218,9 +215,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
|
||||||
|
|
||||||
/* maximum possible samples lavr can output */
|
/* maximum possible samples lavr can output */
|
||||||
delay = avresample_get_delay(s->avr);
|
delay = avresample_get_delay(s->avr);
|
||||||
nb_samples = av_rescale_rnd(in->nb_samples + delay,
|
nb_samples = avresample_get_out_samples(s->avr, in->nb_samples);
|
||||||
outlink->sample_rate, inlink->sample_rate,
|
|
||||||
AV_ROUND_UP);
|
|
||||||
|
|
||||||
out = ff_get_audio_buffer(outlink, nb_samples);
|
out = ff_get_audio_buffer(outlink, nb_samples);
|
||||||
if (!out) {
|
if (!out) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue