af_aresample: allocate a larger buffer so accumulated data can be returned quicker
authorMichael Niedermayer <michaelni@gmx.at>
Sat, 19 May 2012 16:48:05 +0000 (18:48 +0200)
committerMichael Niedermayer <michaelni@gmx.at>
Sat, 19 May 2012 17:23:38 +0000 (19:23 +0200)
Signed-off-by: Michael Niedermayer <michaelni@gmx.at>
libavfilter/af_aresample.c

index e3a88ff..cc479e8 100644 (file)
@@ -165,7 +165,7 @@ static void filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamplesref
 {
     AResampleContext *aresample = inlink->dst->priv;
     const int n_in  = insamplesref->audio->nb_samples;
-    int n_out       = n_in * aresample->ratio + 1;
+    int n_out       = n_in * aresample->ratio * 2 ;
     AVFilterLink *const outlink = inlink->dst->outputs[0];
     AVFilterBufferRef *outsamplesref = ff_get_audio_buffer(outlink, AV_PERM_WRITE, n_out);