From patchwork Thu Feb 22 19:10:04 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Calvin Walton X-Patchwork-Id: 7712 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.150.33 with SMTP id c30csp2406669jai; Thu, 22 Feb 2018 11:19:05 -0800 (PST) X-Google-Smtp-Source: AH8x226szYgK5b9bvfGy+7g6ZRS8ot3bcDi7XdbazyEZE+bRc8gx0v1ul3Wk9Ne/HoByrYJQRqac X-Received: by 10.223.188.18 with SMTP id s18mr7710635wrg.211.1519327145305; Thu, 22 Feb 2018 11:19:05 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1519327145; cv=none; d=google.com; s=arc-20160816; b=vzWYLJsWRqdGvuAK0PIdB0/rWS0s3RcIkn8CNtGVE0RNt+b4w3QGC/3qud9gPbC/rL cLoXReaHEC4qXiRSe2iAkDmbwYW1nk0QNHZM6r3Ts/rM6EmwFmxAL3bsvXfu76TD9erF 5u1+1INZ+9epqIIqH8MBX4ZEim2ZUvkxQcBqjjruNEAq0xNG2MI1q9BH737pQgeXhRFi MHfGmitgkKNVcC5XHs1yRZIumtNYawPjiAVI4pt2vfzJYaaJ0nUiIMm11IjDRiKyp/0G +N/4QNS/VfCLC2YMv06cB5Wp4VCDeTtXiSSasDnpH6vY4EcWfrt7REJx/6MP5HLtJ1fV mDJA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=sender:errors-to:content-transfer-encoding:mime-version:cc:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:references :in-reply-to:message-id:date:to:from:dkim-signature:delivered-to :arc-authentication-results; bh=5jBV1chhayfoAVa9Dav1ehquesECndYkBBi8iUNQ9Gs=; b=P6iO177qcHbeTaf6eo67zYMpVI7leeg3h5HNPNBoMEvvrTpL/yyP6bcAYLunEvTp9P 8zUdcde/OEg9kDv5ttWRuera76u8mqvV1Nyo+/K6RmTyVrZYtXtqApqBui5L/jLKKl7f 5cVrp8jzFrlpZ6Z6FKofaO7cbbwn7KxvZteH8fTs78JKQd0GyHdd6fj9SCruRbBQ+B1J cNqrtV9VTD9f1wcK7YY6Qk5tsXihSs+o1JFrucqKlHZuqT9nQqEGtWrH7vTaWYBxFNS8 2IR/Tf1keTjshi2aFVOygXioc6aJ6zlDwkXATQXI3NyHqI+pXfIhS9F7CuKHnPfHfcfZ NAQg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@kepstin.ca header.s=google header.b=Kd3d0cdp; 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; dmarc=fail (p=NONE sp=REJECT dis=NONE) header.from=kepstin.ca Return-Path: Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org. [79.124.17.100]) by mx.google.com with ESMTP id p203si75408wmb.227.2018.02.22.11.19.04; Thu, 22 Feb 2018 11:19: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; dkim=neutral (body hash did not verify) header.i=@kepstin.ca header.s=google header.b=Kd3d0cdp; 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; dmarc=fail (p=NONE sp=REJECT dis=NONE) header.from=kepstin.ca Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id B13F968A555; Thu, 22 Feb 2018 21:18:55 +0200 (EET) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-it0-f68.google.com (mail-it0-f68.google.com [209.85.214.68]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id E034568A4BC for ; Thu, 22 Feb 2018 21:18:48 +0200 (EET) Received: by mail-it0-f68.google.com with SMTP id a203so2665675itd.1 for ; Thu, 22 Feb 2018 11:18:51 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kepstin.ca; s=google; h=from:to:cc:subject:date:message-id:in-reply-to:references :in-reply-to:references; bh=iBhh+4j8NypM/f0Hf4ArniSWJyl4N03wp26/7t+FOHg=; b=Kd3d0cdpbLE8NgNnyhX2gFL/CSLycAUpFzLhMtGe9QBCsCjxLIkhmQ2uEY55/sBJsb 7NuExPyA/Wn9eQHD5/BYg5RGxq/zY9TdWqX4cuS4Cb/1bO+4/dKuuuzmFBivmgIGxlVW tGCwaH9uCrIpmGV/jrAcr2r2rbzxeODX6QgKU= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:in-reply-to:references; bh=iBhh+4j8NypM/f0Hf4ArniSWJyl4N03wp26/7t+FOHg=; b=FsZ3WPK5cM9/3db0NRvzvlTOxnzkAuHVMZmBs9mQDn8DP2W7vRaHsBzU7YG5a8jaka 7O5bUNjbj5yrvBQ0QLurEFkCnJiXFRhbEOp1pVsyXu/oKorxqmh8adUKz/jaeGYinFmU fGvhGf/TckOhUhw1CZ81l5LkxopuuOmjaxM2poZucgaD2t1R08QQr7XMGisVpI2xikEp 8G0+mxuSJwgqxiqpGFp9B2zPvQn7ORm9EKbsdWe35kDeOwTS4YIVzPymb3XB7utZHAcq hXOmWeMATB5ORVhwqFdHm5iaqXknLh7MSblG/25rf+M+iV7QBo9kWs5eKnM9v3bOx5HX eyEw== X-Gm-Message-State: APf1xPCnfk3L4Bz1KReBDOMaIIUNQfRmDmDD060j+ZeWpBj4Q8ddlJCt o0kdBhNhmsHSvVqpozZXK3zqAnXaUGQ= X-Received: by 10.36.253.7 with SMTP id m7mr343879ith.32.1519326734370; Thu, 22 Feb 2018 11:12:14 -0800 (PST) Received: from saya.kepstin.ca ([2600:16f6:ca87:c180:8398:d8f:5779:6303]) by smtp.gmail.com with ESMTPSA id 67sm398478ioy.32.2018.02.22.11.12.13 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Thu, 22 Feb 2018 11:12:13 -0800 (PST) From: Calvin Walton To: ffmpeg-devel@ffmpeg.org Date: Thu, 22 Feb 2018 14:10:04 -0500 Message-Id: X-Mailer: git-send-email 2.16.2 In-Reply-To: References: In-Reply-To: References: Subject: [FFmpeg-devel] [PATCH v3 2/2] libavfilter/vf_fps: Minor cleanups X-BeenThere: ffmpeg-devel@ffmpeg.org X-Mailman-Version: 2.1.20 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: Calvin Walton MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Since the config_props function now references both the input and output links, rename the 'link' variable to 'outlink'. Fix up some mismatching indentation. Don't bother setting the width and height on the outlink; the filter framework does that for us. --- libavfilter/vf_fps.c | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/libavfilter/vf_fps.c b/libavfilter/vf_fps.c index cc350243a9..9167a00a13 100644 --- a/libavfilter/vf_fps.c +++ b/libavfilter/vf_fps.c @@ -147,16 +147,14 @@ static av_cold void uninit(AVFilterContext *ctx) "%d frames duplicated.\n", s->frames_in, s->frames_out, s->drop, s->dup); } -static int config_props(AVFilterLink* link) +static int config_props(AVFilterLink* outlink) { - AVFilterContext *ctx = link->src; - AVFilterLink *inlink = ctx->inputs[0]; - FPSContext *s = ctx->priv; + AVFilterContext *ctx = outlink->src; + AVFilterLink *inlink = ctx->inputs[0]; + FPSContext *s = ctx->priv; - link->time_base = av_inv_q(s->framerate); - link->frame_rate= s->framerate; - link->w = link->src->inputs[0]->w; - link->h = link->src->inputs[0]->h; + outlink->time_base = av_inv_q(s->framerate); + outlink->frame_rate = s->framerate; /* Calculate the input and output pts offsets for start_time */ if (s->start_time != DBL_MAX && s->start_time != AV_NOPTS_VALUE) { @@ -168,7 +166,7 @@ static int config_props(AVFilterLink* link) } s->in_pts_off = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, inlink->time_base, s->rounding | AV_ROUND_PASS_MINMAX); - s->out_pts_off = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, link->time_base, + s->out_pts_off = av_rescale_q_rnd(first_pts, AV_TIME_BASE_Q, outlink->time_base, s->rounding | AV_ROUND_PASS_MINMAX); s->next_pts = s->out_pts_off; av_log(ctx, AV_LOG_VERBOSE, "Set first pts to (in:%"PRId64" out:%"PRId64") from start time %f\n",