lavr: allocate the resampling buffer with a positive size
authorAnton Khirnov <anton@khirnov.net>
Thu, 20 Mar 2014 19:40:24 +0000 (20:40 +0100)
committerReinhard Tartler <siretart@tauware.de>
Sun, 20 Apr 2014 02:03:29 +0000 (22:03 -0400)
This fixes cases where very few input samples (fewer than needed for one
output sample) are passed to lavr at the beginning.
CC:libav-stable@libav.org

(cherry picked from commit ac976ed91e323754e9a84509873ebdb437372797)
Signed-off-by: Reinhard Tartler <siretart@tauware.de>
libavresample/utils.c

index 2dd3d06..bc295d6 100644 (file)
@@ -184,7 +184,7 @@ int avresample_open(AVAudioResampleContext *avr)
     }
     if (avr->resample_needed) {
         avr->resample_out_buffer = ff_audio_data_alloc(avr->out_channels,
-                                                       0, avr->internal_sample_fmt,
+                                                       1024, avr->internal_sample_fmt,
                                                        "resample_out_buffer");
         if (!avr->resample_out_buffer) {
             ret = AVERROR(EINVAL);