[FFmpeg-cvslog] avfilter/af_rubberband: fix sample overqueueing

Paul B Mahol git at videolan.org
Wed Nov 20 14:17:47 EET 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Wed Nov 20 13:05:50 2019 +0100| [a16de215c917a2d17595116033a7013264aeca44] | committer: Paul B Mahol

avfilter/af_rubberband: fix sample overqueueing

Fixes #8389

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=a16de215c917a2d17595116033a7013264aeca44
---

 libavfilter/af_rubberband.c | 9 ++++++---
 1 file changed, 6 insertions(+), 3 deletions(-)

diff --git a/libavfilter/af_rubberband.c b/libavfilter/af_rubberband.c
index e002d9de17..1dfd74422c 100644
--- a/libavfilter/af_rubberband.c
+++ b/libavfilter/af_rubberband.c
@@ -121,8 +121,9 @@ static int query_formats(AVFilterContext *ctx)
 
 static int filter_frame(AVFilterLink *inlink, AVFrame *in)
 {
-    RubberBandContext *s = inlink->dst->priv;
-    AVFilterLink *outlink = inlink->dst->outputs[0];
+    AVFilterContext *ctx = inlink->dst;
+    RubberBandContext *s = ctx->priv;
+    AVFilterLink *outlink = ctx->outputs[0];
     AVFrame *out;
     int ret = 0, nb_samples;
 
@@ -149,7 +150,9 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     av_frame_free(&in);
-    return ret  < 0 ? ret : nb_samples;
+    if (ff_inlink_queued_samples(inlink) >= s->nb_samples)
+        ff_filter_set_ready(ctx, 100);
+    return ret < 0 ? ret : nb_samples;
 }
 
 static int config_input(AVFilterLink *inlink)



More information about the ffmpeg-cvslog mailing list