From patchwork Fri Mar 1 14:11:07 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Gyan Doshi X-Patchwork-Id: 46687 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:a919:b0:19e:cdac:8cce with SMTP id cd25csp1288962pzb; Fri, 1 Mar 2024 06:12:06 -0800 (PST) X-Forwarded-Encrypted: i=2; AJvYcCWFLjZeCsLs4GFq5u/OmFXwBcPHcjoBdhB+bDEzgYwHk6UaBZNJKLa8A+BIRZq1pSR2/uYpqqKp8H0LHOdNvLxIaGdKMzCLOL46sQ== X-Google-Smtp-Source: AGHT+IGottTxbVFcOTXhP98gJQEDUAg/RUxs9ewvqlIAY6a1XvchVE2HzjQ4G2qrbm7GAqL6g9YO X-Received: by 2002:a05:6402:5bc4:b0:566:6e4e:cb8c with SMTP id gy4-20020a0564025bc400b005666e4ecb8cmr1325860edb.38.1709302325808; Fri, 01 Mar 2024 06:12:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1709302325; cv=none; d=google.com; s=arc-20160816; b=oXgvLkKZZANcOa5GBSms1wFHbrIOs2tc3ClTmzhDOEXaQ22HTqyjOvBmG9Zfw0UAyC HDfY4GdKXYZcL0mDuFJ+RhGVn6qLZrMwn9vs76bIBUKYAJJEtOPSJF0lV+vdgWwTeqao BaY8RfxGWz0N0Sg6xih7LAxVwc700Hnlau7zU4un89TMnAY7EyAlD0n+EAke9wKHwzml vXMsXCZ1FeZDkKcn33yPhr8GAp7qZ4twWEGeqZ4Rz2oZ+u1mzb5hfLmFFC3hoiyViocO wz9bav4IblnbMJH0lXdQyjN2Sh8efQv0gwR4jerIGrPTorr5LCS0jy47KP1iVzKJlYPo WunQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:reply-to:list-subscribe :list-help:list-post:list-archive:list-unsubscribe:list-id :precedence:subject:mime-version:message-id:date:to:from :delivered-to; bh=W207nf9HTAP5P0ApW2j/Vkn2DDr1YliEfT7kmdCPO3k=; fh=YOA8vD9MJZuwZ71F/05pj6KdCjf6jQRmzLS+CATXUQk=; b=fUaITWvnCacitdDzBXEAI/TDHpH/nNRhNEp8wVXquAvT1rIUjw9qq4u1uVgAJFLTI8 omQombgpdyNM/h+jL9lpULydNPnsNV1uAap158rMexZkdz68DKJVaGXQ0QZiZtDEhLGZ tOG77u6tFhAp7zIdnb6A4noDzeBTbXehR05S32asEN47XEhcAAE9eZEOCbi2FPkecK0+ OF1CpDNS2Df6ha5HNkkP7D/Mr8bpjru0RKgUY7adJcxNpQxaj2ILgLh0DLG/9bQl+zuI nlNk4f6HBu3ABuNnItfu1BABK9lWE+8RVbyv1iqFJ9G/v1lr/Hv1fXa8u6vshlIMreJX MzoA==; dara=google.com ARC-Authentication-Results: i=1; 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 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id u26-20020a50c05a000000b00564511aa945si1486688edd.266.2024.03.01.06.12.05; Fri, 01 Mar 2024 06:12:05 -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 F24CF68D273; Fri, 1 Mar 2024 16:12:01 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mout-p-201.mailbox.org (mout-p-201.mailbox.org [80.241.56.171]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id AA50268D1DA for ; Fri, 1 Mar 2024 16:11:54 +0200 (EET) Received: from smtp1.mailbox.org (smtp1.mailbox.org [IPv6:2001:67c:2050:b231:465::1]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (No client certificate requested) by mout-p-201.mailbox.org (Postfix) with ESMTPS id 4TmVQJ0Bh1z9t8C for ; Fri, 1 Mar 2024 15:11:52 +0100 (CET) From: Gyan Doshi To: ffmpeg-devel@ffmpeg.org Date: Fri, 1 Mar 2024 19:41:07 +0530 Message-ID: <20240301141135.23870-1-ffmpeg@gyani.pro> MIME-Version: 1.0 X-Rspamd-Queue-Id: 4TmVQJ0Bh1z9t8C Subject: [FFmpeg-devel] [PATCH] avfilter: update filter timeline state only on main link 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 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: om0LdFlsBdoB At present, consume_update evaluates timeline state on all links for a multi-input filter. This can lead to the filter being incorrectly en/dis-abled when evaluation on a frame on a secondary link leads to a different result than the frame on the current main link next in line for processing. --- libavfilter/avfilter.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c index daa7c3672a..d7ea993508 100644 --- a/libavfilter/avfilter.c +++ b/libavfilter/avfilter.c @@ -1430,7 +1430,8 @@ static void consume_update(FilterLinkInternal *li, const AVFrame *frame) AVFilterLink *const link = &li->l; update_link_current_pts(li, frame->pts); ff_inlink_process_commands(link, frame); - link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame); + if (link == link->dst->inputs[0]) + link->dst->is_disabled = !ff_inlink_evaluate_timeline_at_frame(link, frame); link->frame_count_out++; link->sample_count_out += frame->nb_samples; }