From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.ffmpeg.org (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTPS id A61A04FA19 for ; Tue, 24 Jun 2025 19:24:12 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id D491F68D2DA; Tue, 24 Jun 2025 22:23:39 +0300 (EEST) Received: from iq.passwd.hu (iq.passwd.hu [217.27.212.140]) by ffbox0-bg.ffmpeg.org (Postfix) with ESMTP id 7BB3A68D27B for ; Tue, 24 Jun 2025 22:23:33 +0300 (EEST) Received: from localhost (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 05ADDE9F05; Tue, 24 Jun 2025 21:20:46 +0200 (CEST) X-Virus-Scanned: amavisd-new at passwd.hu Received: from iq.passwd.hu ([127.0.0.1]) by localhost (iq.passwd.hu [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id CVghHv62GzpV; Tue, 24 Jun 2025 21:20:44 +0200 (CEST) Received: from bluegene.passwd.hu (localhost [127.0.0.1]) by iq.passwd.hu (Postfix) with ESMTP id 66AF2E9E73; Tue, 24 Jun 2025 21:20:44 +0200 (CEST) From: Marton Balint To: ffmpeg-devel@ffmpeg.org Date: Tue, 24 Jun 2025 21:23:01 +0200 Message-ID: <20250624192318.7430-3-cus@passwd.hu> X-Mailer: git-send-email 2.43.0 In-Reply-To: <20250624192318.7430-1-cus@passwd.hu> References: <20250624192318.7430-1-cus@passwd.hu> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 03/12] avfilter/avfilter: fix forwarding EOF for simple API filters in filter_activate_default X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.29 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 Cc: Marton Balint Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Archived-At: List-Archive: List-Post: EOF only need to be forwarded back if all outputs have reached EOF. Fixes infinte loop with ffprobe -f lavfi -i "smptebars=d=1,select=n=2:e=1[out0][out1]" Regression since d9e41ead82263e96ebd14d4d88d6e7f858dd944c. Fixes ticket #10959. Fixes ticket #11366. Signed-off-by: Marton Balint --- libavfilter/avfilter.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index 56f635a413..dd12533208 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1253,16 +1253,14 @@ static int forward_status_change(AVFilterContext *filter, FilterLinkInternal *li static int filter_activate_default(AVFilterContext *filter) { unsigned i; + int nb_eofs = 0; - for (i = 0; i < filter->nb_outputs; i++) { - FilterLinkInternal *li = ff_link_internal(filter->outputs[i]); - int ret = li->status_in; - - if (ret) { - for (int j = 0; j < filter->nb_inputs; j++) - ff_inlink_set_status(filter->inputs[j], ret); - return 0; - } + for (i = 0; i < filter->nb_outputs; i++) + nb_eofs += ff_outlink_get_status(filter->outputs[i]) == AVERROR_EOF; + if (filter->nb_outputs && nb_eofs == filter->nb_outputs) { + for (int j = 0; j < filter->nb_inputs; j++) + ff_inlink_set_status(filter->inputs[j], AVERROR_EOF); + return 0; } for (i = 0; i < filter->nb_inputs; i++) { -- 2.43.0 _______________________________________________ ffmpeg-devel mailing list ffmpeg-devel@ffmpeg.org https://ffmpeg.org/mailman/listinfo/ffmpeg-devel To unsubscribe, visit link above, or email ffmpeg-devel-request@ffmpeg.org with subject "unsubscribe".