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)
committerAnton Khirnov <anton@khirnov.net>
Sun, 13 Apr 2014 09:21:20 +0000 (11:21 +0200)
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

libavresample/utils.c

index 63d6530..35bee42 100644 (file)
@@ -189,7 +189,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);