Commit 616e6ffa authored by Michael Niedermayer's avatar Michael Niedermayer

aresample: increase n_out buffer size a bit to reduce delay in some corner cases

Signed-off-by: 's avatarMichael Niedermayer <michaelni@gmx.at>
parent 7726916c
...@@ -174,7 +174,7 @@ static int filter_frame(AVFilterLink *inlink, AVFilterBufferRef *insamplesref) ...@@ -174,7 +174,7 @@ static int filter_frame(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 = FFMAX(n_in * aresample->ratio * 2, 1); int n_out = n_in * aresample->ratio * 2 + 256;
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);
int ret; int ret;
......
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