Le primidi 1er nivôse, an CCXXV, Marton Balint a écrit :
> It seems after this patch I got an infinite loop if I try to convert the
> attached file using this command line:
> 
> ./ffmpeg -i amerge-test.mov -filter_complex "[0:a:0][0:a:1]amerge=2[aout]"
> -map "[aout]" out.wav

Can you confirm the attached patch fixes the issue?

If so, please do not hesitate to push it without waiting for me if (and
only if) that is convenient for you.

> Note that in my build FF_BUFQUEUE_SIZE in libavfilter/bufferqueue.h is set
> to 256, because otherwise it errors out with ENOMEM, but that also happens
> with the old filtering code. On the other hand, the old filtering code and
> FF_BUFQUEUE_SIZE set to 256 does allow the file to properly convert.

I wish I remembered that precision before spending time tracking the
ENOMEM :(

Fortunately, one of the perks of these changes is they are a step closer
to getting rid of that particular issue once and for all. I suspect
rudimentary memory limitation will be needed first, but that can be
managed.

Regards,

-- 
  Nicolas George
From 7006d17b617279f1fc0a35650869e552ca5eefcb Mon Sep 17 00:00:00 2001
From: Nicolas George <geo...@nsup.org>
Date: Thu, 22 Dec 2016 12:04:12 +0100
Subject: [PATCH] af_amerge: detect EOF immediately.

Fix an infinite loop in forward_status_change().

Signed-off-by: Nicolas George <geo...@nsup.org>
---
 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 4a8c6d5bd0..40bf7ab209 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;
-- 
2.11.0

Attachment: signature.asc
Description: Digital signature

_______________________________________________
ffmpeg-devel mailing list
ffmpeg-devel@ffmpeg.org
http://ffmpeg.org/mailman/listinfo/ffmpeg-devel

Reply via email to