From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by master.gitmailbox.com (Postfix) with ESMTP id 979C0467B6 for ; Sun, 18 Jun 2023 11:22:52 +0000 (UTC) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id C447068C209; Sun, 18 Jun 2023 14:20:30 +0300 (EEST) 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 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: 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; } -- 2.41.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".