[FFmpeg-cvslog] avfilter/af_rubberband: handle case when no frame is given

Paul B Mahol git at videolan.org
Mon May 6 22:07:48 EEST 2019


ffmpeg | branch: master | Paul B Mahol <onemda at gmail.com> | Mon May  6 21:04:52 2019 +0200| [066864aca830bf5e18aef6bb904b475acd787cd3] | committer: Paul B Mahol

avfilter/af_rubberband: handle case when no frame is given

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

 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 10471bc94d..325da72028 100644
--- a/libavfilter/af_rubberband.c
+++ b/libavfilter/af_rubberband.c
@@ -148,7 +148,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in)
     }
 
     av_frame_free(&in);
-    return ret;
+    return ret  < 0 ? ret : nb_samples;
 }
 
 static int config_input(AVFilterLink *inlink)
@@ -184,8 +184,11 @@ static int activate(AVFilterContext *ctx)
     ret = ff_inlink_consume_samples(inlink, s->nb_samples, s->nb_samples, &in);
     if (ret < 0)
         return ret;
-    if (ret > 0)
-        return filter_frame(inlink, in);
+    if (ret > 0) {
+        ret = filter_frame(inlink, in);
+        if (ret > 0)
+            return ret;
+    }
 
     FF_FILTER_FORWARD_STATUS(inlink, outlink);
     FF_FILTER_FORWARD_WANTED(outlink, inlink);



More information about the ffmpeg-cvslog mailing list