From patchwork Thu Dec 22 11:18:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 1886 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp589706vsb; Thu, 22 Dec 2016 03:18:38 -0800 (PST) X-Received: by 10.28.221.11 with SMTP id u11mr8749118wmg.91.1482405518213; Thu, 22 Dec 2016 03:18:38 -0800 (PST) Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id h3si31447277wjk.144.2016.12.22.03.18.37; Thu, 22 Dec 2016 03:18:38 -0800 (PST) Received-SPF: pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) client-ip=79.124.17.100; Authentication-Results: mx.google.com; spf=pass (google.com: domain of ffmpeg-devel-bounces@ffmpeg.org designates 79.124.17.100 as permitted sender) smtp.mailfrom=ffmpeg-devel-bounces@ffmpeg.org Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 837F368A436; Thu, 22 Dec 2016 13:18:34 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 4453168A189 for ; Thu, 22 Dec 2016 13:18:28 +0200 (EET) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id uBMBIST6032150 for ; Thu, 22 Dec 2016 12:18:28 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id 3AEA4E00F1; Thu, 22 Dec 2016 12:18:28 +0100 (CET) Date: Thu, 22 Dec 2016 12:18:28 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: <20161222111828.GA767956@phare.normalesup.org> References: <20161127160852.5460-1-george@nsup.org> <20161127160852.5460-2-george@nsup.org> <20161203155800.GA1110317@phare.normalesup.org> <20161211163620.GA2114857@phare.normalesup.org> <20161218095103.GA2317487@phare.normalesup.org> MIME-Version: 1.0 In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 22 Dec 2016 12:18:28 +0100 (CET) Subject: Re: [FFmpeg-devel] [PATCH 2/2] lavfi: make filter_frame non-recursive. X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 Precedence: list List-Id: FFmpeg development discussions and patches List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Reply-To: FFmpeg development discussions and patches Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" 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, From 7006d17b617279f1fc0a35650869e552ca5eefcb Mon Sep 17 00:00:00 2001 From: Nicolas George 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 --- 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