From patchwork Fri Dec 23 10:25:07 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 1898 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.103.89.21 with SMTP id n21csp1076773vsb; Fri, 23 Dec 2016 02:25:18 -0800 (PST) X-Received: by 10.194.141.15 with SMTP id rk15mr7939175wjb.81.1482488718108; Fri, 23 Dec 2016 02:25:18 -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 d12si6152946wme.5.2016.12.23.02.25.17; Fri, 23 Dec 2016 02:25:18 -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 50ECF68A259; Fri, 23 Dec 2016 12:25:14 +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 9CB5368A212 for ; Fri, 23 Dec 2016 12:25:07 +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 uBNAP8IW012562 for ; Fri, 23 Dec 2016 11:25:08 +0100 (CET) Received: by phare.normalesup.org (Postfix, from userid 1001) id F3925E00E9; Fri, 23 Dec 2016 11:25:07 +0100 (CET) Date: Fri, 23 Dec 2016 11:25:07 +0100 From: Nicolas George To: FFmpeg development discussions and patches Message-ID: <20161223102507.GA1492601@phare.normalesup.org> References: <20161127160852.5460-1-george@nsup.org> <20161127160852.5460-2-george@nsup.org> <20161223085015.GA1414800@phare.normalesup.org> MIME-Version: 1.0 In-Reply-To: <20161223085015.GA1414800@phare.normalesup.org> 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]); Fri, 23 Dec 2016 11:25:08 +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 tridi 3 nivôse, an CCXXV, Nicolas George a écrit : > Yes, thanks. This is the glitch I am currently working on, and I think > it is almost fixed cleanly. Note that the actual time is still very > small, it is only ffmpeg keeps thinking the filter is not ready and > sleeping. Actually, it was not exactly the same. Please see the attached patch. Regards, From c7f2f6d8e2ea776dc4c097685dc0e8255051d1ee Mon Sep 17 00:00:00 2001 From: Nicolas George Date: Fri, 23 Dec 2016 11:18:09 +0100 Subject: [PATCH] lavfi: avfilter_graph_request_oldest: request a frame again before returning. With min_samples, if a frame arrives but is too small, it clears frame_wanted_out. In most cases, the destination filter would be activated again later because of frame_wanted_out on its own outputs, but not sinks. avfilter_graph_request_oldest() is doing the work of the sink itself, and is therefore allowed to use frame_blocked_in. Signed-off-by: Nicolas George --- libavfilter/avfiltergraph.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libavfilter/avfiltergraph.c b/libavfilter/avfiltergraph.c index 6b5a6f34ec..cb5d618ab1 100644 --- a/libavfilter/avfiltergraph.c +++ b/libavfilter/avfiltergraph.c @@ -1407,7 +1407,11 @@ int avfilter_graph_request_oldest(AVFilterGraph *graph) frame_count = oldest->frame_count_out; while (frame_count == oldest->frame_count_out) { r = ff_filter_graph_run_once(graph); - if (r < 0) + if (r == AVERROR(EAGAIN) && + !oldest->frame_wanted_out && !oldest->frame_blocked_in && + !oldest->status_in) + ff_request_frame(oldest); + else if (r < 0) return r; } return 0; -- 2.11.0