[FFmpeg-cvslog] avfilter/af_amerge: detect EOF immediately

Nicolas George git at videolan.org
Fri Dec 23 05:07:50 EET 2016


ffmpeg | branch: master | Nicolas George <george at nsup.org> | Thu Dec 22 12:04:12 2016 +0100| [8156b5ac94368e5d4ddc66675ededf9b5dd507ab] | committer: Marton Balint

avfilter/af_amerge: detect EOF immediately

Fix an infinite loop in forward_status_change().

Signed-off-by: Nicolas George <george at nsup.org>
Signed-off-by: Marton Balint <cus at passwd.hu>

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

 libavfilter/af_amerge.c | 7 ++++++-
 1 file changed, 6 insertions(+), 1 deletion(-)

diff --git a/libavfilter/af_amerge.c b/libavfilter/af_amerge.c
index 4a8c6d5..40bf7ab 100644
--- a/libavfilter/af_amerge.c
+++ b/libavfilter/af_amerge.c
@@ -23,6 +23,9 @@
  * Audio merging filter
  */
 
+#define FF_INTERNAL_FIELDS 1
+#include "framequeue.h"
+
 #include "libavutil/avstring.h"
 #include "libavutil/bprint.h"
 #include "libavutil/channel_layout.h"
@@ -182,7 +185,9 @@ static int request_frame(AVFilterLink *outlink)
     int i, ret;
 
     for (i = 0; i < s->nb_inputs; i++)
-        if (!s->in[i].nb_samples)
+        if (!s->in[i].nb_samples ||
+            /* detect EOF immediately */
+            (ctx->inputs[i]->status_in && !ctx->inputs[i]->status_out))
             if ((ret = ff_request_frame(ctx->inputs[i])) < 0)
                 return ret;
     return 0;



More information about the ffmpeg-cvslog mailing list