From patchwork Sun Jun 18 11:17:02 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 42200 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be15:b0:121:b37c:e101 with SMTP id ge21csp57289pzb; Sun, 18 Jun 2023 04:22:57 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ6j3MDlamAs7Ak4V3glJMoFaaRq3UVp1Q529Cpz13/rtjcSFbImiYand7NQzTHxvESb43U9 X-Received: by 2002:a17:907:3187:b0:96f:c0b0:f137 with SMTP id xe7-20020a170907318700b0096fc0b0f137mr6681513ejb.16.1687087377026; Sun, 18 Jun 2023 04:22:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687087377; cv=none; d=google.com; s=arc-20160816; b=yNMpTk6SIebnrFCaUBtAgj/ZkXtXY4zUN7k9kLA+OhJY0aEGYhlGn3MHIanVvcU8PZ nox91mXxM74GZ+Xus9BRFiTTsNQf7f4whliaK4JJFBwfdFbhXVYTOBGbIr5sU2rcAbUr NOsOyQtm6VWo/azrelSM2uRZxnMGur2yVeiUvHjUvMMbQnpR45OjNjxvDfCAbp/4+Itn NE5N9D7QKwy1hj8SKO/z28hKtFY8CG/sktG/8RF6x2FvgmlDJmhFVurCOA8HsUgWDsDI nWB9M/3wLVbW2h26681edTkzxW9ikLCS5AqY8OdDg3DL7BKdad26myZ4+iB0lLHC+mA/ rIcA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:mime-version:references:in-reply-to :message-id:date:to:from:dkim-signature:delivered-to; bh=xUFAoR/Ws6u+4nTUXNcX73Dgu+3dkO7lOusbX6SXzts=; b=VmrsRHY5/HdfCi2C3+0BLGe9G+1/GmqWypX6TdhRCa+kr0q63xQLfmSNJtA2Mt+G8H 0dpFL82+3gSSFIWAlLEnWMm+kWkeYYkr7b3HXp612wnPXKRoZsFfseFn/7Gd339IcbAn 5gIBf/jY8GQsAdgLrPyx+O96nrs3ZuEv3MMZRtLCU7VVE6/0zcxAVVyae9mc2grIvBBr FqqcS7pxQqpj/gU70LLKUhSersviU6U6wbWinXE/EogTByBg61beOljXYX6EaZwIheRn Ss/USf9LgS9hSZYzguIlbgYGyzEEwAhDFEhojishf5pZfCttQhK8bOwHLAt9wEQ6WFLq kxuw== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=jFL7YVu9; 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 v3-20020a1709064e8300b00987d075c49csi1451096eju.805.2023.06.18.04.22.54; Sun, 18 Jun 2023 04:22:57 -0700 (PDT) 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; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=jFL7YVu9; 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 30E1D68C20B; Sun, 18 Jun 2023 14:20:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from haasn.dev (haasn.dev [78.46.187.166]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 3501368C062 for ; Sun, 18 Jun 2023 14:20:14 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id C858541BA3; Sun, 18 Jun 2023 13:20:10 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1687087210; bh=zBLG4Uynu0z+sb/RLw2piUYR7ic+93PvDlwQbUTvJ+U=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=jFL7YVu9kGtnEceYRjf5dPaYVBusy85XTrIfaC0ZRVBltgybv6QN+GDgWAcGHvxN4 ZX20BQ2Qn+3Rs88bkxcsyL2cmXe6pV42WA+QVVgMRiTXeAiH8U8hRFFnFnAZGAbT9K bYW41qqc3OzrhWRVRn8YBmQlMRZ/ff8SxXMZ050Y= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Jun 2023 13:17:02 +0200 Message-ID: <20230618111955.40994-12-ffmpeg@haasn.xyz> X-Mailer: git-send-email 2.41.0 In-Reply-To: <20230618111955.40994-2-ffmpeg@haasn.xyz> References: <20230618111955.40994-2-ffmpeg@haasn.xyz> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH v2 10/22] lavfi/vf_libplacebo: keep track of latest status globally 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: Niklas Haas Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" X-TUID: dY7ms9IowHk9 From: Niklas Haas This field will effectively hold the most recent status set by any input. Currently functionally equivalent to input->status, but will change soon. --- libavfilter/vf_libplacebo.c | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index ee8780036cf..5b45d4f8fb5 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -138,6 +138,8 @@ typedef struct LibplaceboContext { /* input state */ LibplaceboInput *inputs; int nb_inputs; + int64_t status_pts; ///< tracks status of most recently used input + int status; /* settings */ char *out_format_string; @@ -943,6 +945,11 @@ static int handle_input(AVFilterContext *ctx, LibplaceboInput *input) pl_queue_push(input->queue, NULL); /* Signal EOF to pl_queue */ input->status = status; input->status_pts = pts; + if (!s->status || pts >= s->status_pts) { + /* Also propagate to output unless overwritten by later status change */ + s->status = status; + s->status_pts = pts; + } } return 0; @@ -975,8 +982,8 @@ static int libplacebo_activate(AVFilterContext *ctx) } } - if (in->status && pts >= in->status_pts) { - ff_outlink_set_status(outlink, in->status, in->status_pts); + if (s->status && pts >= s->status_pts) { + ff_outlink_set_status(outlink, s->status, s->status_pts); return 0; }