From patchwork Mon Oct 10 16:10:48 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Anton Khirnov X-Patchwork-Id: 38674 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:4a86:b0:9d:28a3:170e with SMTP id fn6csp443314pzb; Mon, 10 Oct 2022 09:11:43 -0700 (PDT) X-Google-Smtp-Source: AMsMyM522KbS0D0+oUijdI/fOkvP5YpvX5K+jmhPF5/aup2vU8ULbAiApqzVODcdnfWfTKrFxCF2 X-Received: by 2002:a50:fb0f:0:b0:458:df03:c3aa with SMTP id d15-20020a50fb0f000000b00458df03c3aamr18304071edq.83.1665418303429; Mon, 10 Oct 2022 09:11:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1665418303; cv=none; d=google.com; s=arc-20160816; b=x1i8lpchn2FE2cVg6b0dRaulbrBN0DgM42zYKQOzW540jSmxIKvd9TDT8WK7HGnnoZ B6uoAIQE8TqrQ6bnodwh2L15s6R7ylzsab41BbnOmLyBMn7831F84WMPTdC4mK51E4hx Y5rv7YGxyVjR11WpL4qa72zVuF3KZpMsjAXzDN9waq1hff479DyP6fw8e26GIjlaqiGs zwTP6RTC6QuYrRIm4PFfrHX2X866ZsPwaxH4GwnBq3HHMxelNyKWX0EIGh94bsAKLLsc pSdeQSGCqeXkNPsMygP2HzTEmtPKj64Yh28rpE2/MGUfsKdZ/GBfbB12fU3KjBhLBIhv rVzQ== 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=cZ7RTSVrGiL3QKHSMlbBxY8nOb7449UCQPV3okd1ynU=; b=SDJNeOo4zLIpcD+7B4ueRoG8REvimfL6zT7I8fMUefEJsMHRVpNtyDwLoZNTujYn2L NaaO/WGDgsUKd9pOc0JFmfHkjmaZxiOLL87Jgb8Kq90Y+vwh+eTironO+AdXXAv87HBk l5fSmCeOr2gYjCnPWyu3hWF3UNz734YWD6TwK7guY0wuWXHpS2DXZ/DEYjgFRqJ/V0NT X4xwRVxC7ca/AMQ/r029x2ZjPtMNlM82lxJZzdMLOh8375ByfrtlvGXjg5//hV3hyB0t yIQL/kCZ7SPOVz5IMJzOn6UEK5F98CNUJbZfW6P2WMtwKC/kRrXZzdJaLnINji6E4pjg KtqA== 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 j11-20020a05640211cb00b00451e1aae675si12737881edw.547.2022.10.10.09.11.43; Mon, 10 Oct 2022 09:11:43 -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 C698D68BCCD; Mon, 10 Oct 2022 19:11:19 +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 F080A68BCD3 for ; Mon, 10 Oct 2022 19:11:10 +0300 (EEST) Received: from localhost (localhost [IPv6:::1]) by mail0.khirnov.net (Postfix) with ESMTP id 64CA12404F7 for ; Mon, 10 Oct 2022 18:11:10 +0200 (CEST) Received: from mail0.khirnov.net ([IPv6:::1]) by localhost (mail0.khirnov.net [IPv6:::1]) (amavisd-new, port 10024) with ESMTP id JVlUi2DGyM8d for ; Mon, 10 Oct 2022 18:11:07 +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 21F272400F4 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 010533A015F 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:48 +0200 Message-Id: <20221010161055.18948-1-anton@khirnov.net> X-Mailer: git-send-email 2.35.1 MIME-Version: 1.0 Subject: [FFmpeg-devel] [PATCH 1/8] lavfi/f_drawgraph: forward input 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: dcu3xgO0g6gB --- libavfilter/f_drawgraph.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/libavfilter/f_drawgraph.c b/libavfilter/f_drawgraph.c index 000255fc52..d29a7fb60a 100644 --- a/libavfilter/f_drawgraph.c +++ b/libavfilter/f_drawgraph.c @@ -168,7 +168,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) AVDictionaryEntry *e; AVFrame *out = s->out; AVFrame *clone = NULL; - int64_t in_pts, out_pts; + int64_t in_pts, out_pts, in_duration; int i; if (s->slide == 4 && s->nb_values >= s->values_size[0] / sizeof(float)) { @@ -320,6 +320,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) s->x++; in_pts = in->pts; + in_duration = in->duration; av_frame_free(&in); @@ -336,6 +337,7 @@ static int filter_frame(AVFilterLink *inlink, AVFrame *in) return AVERROR(ENOMEM); clone->pts = s->prev_pts = out_pts; + clone->duration = av_rescale_q(in_duration, inlink->time_base, outlink->time_base); return ff_filter_frame(outlink, clone); }