[FFmpeg-devel] [PATCH] lavfi: asetnsamples: fix enlarging fifo

Andrey Utkin andrey.krieger.utkin at gmail.com
Mon Aug 6 22:04:44 CEST 2012


---
 libavfilter/af_asetnsamples.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)

diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index 8805d53..e00980e 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -141,7 +141,7 @@ static int filter_samples(AVFilterLink *inlink, AVFilterBufferRef *insamples)
 
     if (av_audio_fifo_space(asns->fifo) < nb_samples) {
         av_log(ctx, AV_LOG_DEBUG, "No space for %d samples, stretching audio fifo\n", nb_samples);
-        ret = av_audio_fifo_realloc(asns->fifo, av_audio_fifo_size(asns->fifo) + nb_samples);
+        ret = av_audio_fifo_realloc(asns->fifo, av_audio_fifo_size(asns->fifo) + av_audio_fifo_space(asns->fifo) + nb_samples);
         if (ret < 0) {
             av_log(ctx, AV_LOG_ERROR,
                    "Stretching audio fifo failed, discarded %d samples\n", nb_samples);
-- 
1.7.8.6



More information about the ffmpeg-devel mailing list