From patchwork Mon Oct 10 16:10:55 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38678 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443624pzb; Mon, 10 Oct 2022 09:12:25 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7iTU6/UE2p30EKjoEXV+uYAlFtjojokEoo4woGq1NKtlm6YHyMZl22IfF4eWD6vNJq7cuT X-Received: by 2002:a05:6402:2748:b0:459:15fe:a868 with SMTP id z8-20020a056402274800b0045915fea868mr18297430edd.157.1665418345061; Mon, 10 Oct 2022 09:12:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418345; cv=none; d=google.com; s=arc-20160816; b=YrKSdYYDf4vS/Tij/bMbUUTo1mxHic+pAFmf9nPhR4nqQjSotKgKE8RJGujX1nJOEr icVNxBfg5uo1FfUo2oOjpQXt4YwXr/pWrbGGdHi8NdFdw6aPhE7L6k3u9Wc6XzNyI73+ +aGXGxu8CvdizaxoJoZViYz47cCEJ+0JOBoeDayvPLjLyi/ZvU8+1qeSzKmzTIWmeqsm oSQqfEp4iu823sW5CS5dCDPvPa4LqRWmI+0hMI+8CqPG7/f1jsH+0Ce2/MZOcpujYaqR 6iVQ2zr3WzMkU14008VusIpdOS0rP6OTzPErlX82mrKU/hmugeDt8vdaxPzDBX144Kum e2VQ== 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:references:in-reply-to:message-id :date:to:from:delivered-to; bh=xHNu2VGyePAMggANDGQcn/7Tr8MSevI8AiTu+tqHvBw=; b=cuUjpjl4f6bc4synIKam3XMk4EOupyjwJI2Mbe4JO91OJjG05mnGibiTDFLT4cj08y MrwwOgHmfJLxlJZ0cepbb8aJ9uXkyAooU91BQamrUXpMiVctDyWcYyetybicQ8TJAFzi A/l4ZfqRhIqBzOpZApROV+vMXFavUwVN7TUphuPToWffQvcC4iOx6kRRrCldG1MafP9a katbd3aR7dCoJDHJjv1KdLV3xbnqaxVMSB8CXvhZSkyGfLftCOGi88irpL8B31K9S0bl wad0oO8IRh4BZ8hTbrNuGpeAg4d6VZ/OsB5tXbv5akTIFY/n1tEsyAugfjtQUHHmx0GQ IWLQ== 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 mp11-20020a1709071b0b00b0076fb816dae7si12539173ejc.97.2022.10.10.09.12.24; Mon, 10 Oct 2022 09:12:25 -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; 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 ED29668BD2E; Mon, 10 Oct 2022 19:11:23 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail0.khirnov.net (red.khirnov.net [176.97.15.12]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 3181D68BD1F for ; Mon, 10 Oct 2022 19:11:16 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id D2753240591 for ; Mon, 10 Oct 2022 18:11:11 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id zqh-lg7vmGhU for ; Mon, 10 Oct 2022 18:11:11 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:2a00:c500:561:201::7]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256 client-signature RSA-PSS (2048 bits) client-digest SHA256) (Client CN "libav.khirnov.net", Issuer "smtp.khirnov.net SMTP CA" (verified OK)) by mail0.khirnov.net (Postfix) with ESMTPS id 65E9D2405EC for ; Mon, 10 Oct 2022 18:11:07 +0200 (CEST) Received: from libav.khirnov.net (libav.khirnov.net [IPv6:::1]) by libav.khirnov.net (Postfix) with ESMTP id 1F57F3A169F for ; Mon, 10 Oct 2022 18:11:02 +0200 (CEST) From: Anton Khirnov To: ffmpeg-devel@ffmpeg.org Date: Mon, 10 Oct 2022 18:10:55 +0200 Message-Id: <20221010161055.18948-8-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 In-Reply-To: <20221010161055.18948-1-anton@khirnov.net> References: <20221010161055.18948-1-anton@khirnov.net> MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 8/8] lavfi/vf_estdif: set frame durations 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: rnooYqey/0G4 --- libavfilter/vf_estdif.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/libavfilter/vf_estdif.c b/libavfilter/vf_estdif.c index 9e826fd424..0164f4638a 100644 --- a/libavfilter/vf_estdif.c +++ b/libavfilter/vf_estdif.c @@ -432,7 +432,7 @@ static int deinterlace_slice(AVFilterContext *ctx, void *arg, return 0; } -static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts) +static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts, int64_t duration) { ESTDIFContext *s = ctx->priv; AVFilterLink *outlink = ctx->outputs[0]; @@ -445,6 +445,7 @@ static int filter(AVFilterContext *ctx, AVFrame *in, int64_t pts) av_frame_copy_props(out, in); out->interlaced_frame = 0; out->pts = pts; + out->duration = duration; td.out = out; td.in = in; ff_filter_execute(ctx, deinterlace_slice, &td, NULL, @@ -503,19 +504,21 @@ static int config_input(AVFilterLink *inlink) if ((s->deint && !s->prev->interlaced_frame) || ctx->is_disabled) { s->prev->pts *= 2; + s->prev->duration *= 2; ret = ff_filter_frame(ctx->outputs[0], s->prev); s->prev = in; return ret; } - ret = filter(ctx, s->prev, s->prev->pts * 2); + ret = filter(ctx, s->prev, s->prev->pts * 2, + s->prev->duration * (s->mode ? 1 : 2)); if (ret < 0 || s->mode == 0) { av_frame_free(&s->prev); s->prev = in; return ret; } - ret = filter(ctx, s->prev, s->prev->pts + in->pts); + ret = filter(ctx, s->prev, s->prev->pts + in->pts, in->duration); av_frame_free(&s->prev); s->prev = in; return ret;