From patchwork Sun Jun 18 11:16:56 2023 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Niklas Haas X-Patchwork-Id: 42187 Delivered-To: ffmpegpatchwork2@gmail.com Received: by 2002:a05:6a20:be15:b0:121:b37c:e101 with SMTP id ge21csp56524pzb; Sun, 18 Jun 2023 04:20:54 -0700 (PDT) X-Google-Smtp-Source: ACHHUZ5gOVIfqKxGu0aDXP5qAKtAzW6FzjgCiHEvd4hk9wCilCqbGA8WEjjgne81Mzf7pEF2tJBg X-Received: by 2002:a17:907:97d2:b0:978:8685:71cd with SMTP id js18-20020a17090797d200b00978868571cdmr6969104ejc.71.1687087253896; Sun, 18 Jun 2023 04:20:53 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1687087253; cv=none; d=google.com; s=arc-20160816; b=y9MHv5R0/5ZGwxRdIQtsMiyHOxLTwCoFHeHMQ7ZZWugo/zxtVP77oTxR/BUJFtlD2U p/uV5GCGdDCPf/f/ub+dCnh8RZ059lcKwqkVMC+eQr2L6s5Nygcabc6Q5GYKiYhHVrOj ROw+J1bZLTzgmemQxXpWM/1azJcrpg1Du8bRBxIYMZ24W+hdhtRiW0rotTK8IlZT0bzi RUt+02c/9BaSzkqeEnkKA55PSRVIWHEKxeFP/BQQ8pXflBsvDvUWqwlZ3uQC5LqgSiok fR1xqf/H2LGnioA3UIL0rhtsy3pcqV6tUChkCSn5Qp9hTi1xuOGPrnjrHCI8eQ8Ummhi Kbqw== 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=O2O2S+pVmcNaxzINjymCIuloqQwHftWtKUO8FV8kfVE=; b=SWdQwLl9xF10IP34mET6ygKtISymUJcUMm3CqcpQuQaZWIpsNi/3dpkHbYL1DwuoM8 mQvlepB+zAsSK2fs6aNgsyHBIhs3FLeZ5cuiKZBbe6qCDcE/CEEhvDMlQ9b5lZSWweKI IB0sKZgvg8XIcTfdA7S4KCRYVq3si0ITby57+/rtSnI2DDYBj4oK9iVm/IH1XOaZ5ML+ 5o+DgiCKbUCS7sE3yW4OzyqTZlaVp4XLI5tLlh4WdW6N53A8SfzhLFcJyIG3Gy4NwJAg bb1ZI/A/LNCzWzwKPTfvUt30LY6ht8SJ2Mq7aIapKM93C+PsDowD1JysDwhuPLFW/XVO UAVg== ARC-Authentication-Results: i=1; mx.google.com; dkim=neutral (body hash did not verify) header.i=@haasn.xyz header.s=mail header.b=pY1mLdrG; 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 p24-20020a1709061b5800b009888b71c367si301875ejg.720.2023.06.18.04.20.52; Sun, 18 Jun 2023 04:20:53 -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=pY1mLdrG; 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 8C69768BFF2; Sun, 18 Jun 2023 14:20:17 +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 8808F68BF5A for ; Sun, 18 Jun 2023 14:20:09 +0300 (EEST) Received: from haasn.dev (unknown [10.30.0.2]) by haasn.dev (Postfix) with ESMTP id 3E33D436B4; Sun, 18 Jun 2023 13:20:09 +0200 (CEST) DKIM-Signature: v=1; a=rsa-sha256; c=simple/simple; d=haasn.xyz; s=mail; t=1687087209; bh=BMaBBmBWW/DHey1UfXn+O84YiqBWY/EXo/Heb9rc98s=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=pY1mLdrGFtPCQW2cVfJII+EAcEPUABdIhOCTxNHGtX7Ska17AGyxSwjasdDFfjG8R /0NCIWvKya33NZqN+0wTo8BBw4thpY9X8xFv8QsoVZxv6ibv8A97MOsYpy3/4HuYxl q6iAXbNnRg/tWpFsgvjsEmuEcAT7O1+VSD8UF2jU= From: Niklas Haas To: ffmpeg-devel@ffmpeg.org Date: Sun, 18 Jun 2023 13:16:56 +0200 Message-ID: <20230618111955.40994-6-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 04/22] lavfi/vf_libplacebo: cosmetic 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: OCVE/vTtK14O From: Niklas Haas Assign local variable 'in' for 's->input' and replace 'inlink' by 'in->link' to avoid hard-coding ID 0 in more than one place. --- libavfilter/vf_libplacebo.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/libavfilter/vf_libplacebo.c b/libavfilter/vf_libplacebo.c index 879a3a05086..beddd2f796d 100644 --- a/libavfilter/vf_libplacebo.c +++ b/libavfilter/vf_libplacebo.c @@ -941,14 +941,14 @@ static int libplacebo_activate(AVFilterContext *ctx) { int ret; LibplaceboContext *s = ctx->priv; - AVFilterLink *inlink = ctx->inputs[0]; + LibplaceboInput *in = &s->input; AVFilterLink *outlink = ctx->outputs[0]; int64_t pts; - FF_FILTER_FORWARD_STATUS_BACK(outlink, inlink); + FF_FILTER_FORWARD_STATUS_BACK(outlink, in->link); pl_log_level_update(s->log, get_log_level()); - if ((ret = handle_input(ctx, &s->input)) < 0) + if ((ret = handle_input(ctx, in)) < 0) return ret; if (ff_outlink_frame_wanted(outlink)) { @@ -957,22 +957,22 @@ static int libplacebo_activate(AVFilterContext *ctx) if (s->fps.num) { pts = outlink->frame_count_out; - } else if (av_fifo_peek(s->input.out_pts, &pts, 1, 0) < 0) { + } else if (av_fifo_peek(in->out_pts, &pts, 1, 0) < 0) { /* No frames queued */ - if (s->input.status) { - pts = s->input.status_pts; + if (in->status) { + pts = in->status_pts; } else { - ff_inlink_request_frame(inlink); + ff_inlink_request_frame(in->link); return 0; } } - if (s->input.status && pts >= s->input.status_pts) { - ff_outlink_set_status(outlink, s->input.status, s->input.status_pts); + if (in->status && pts >= in->status_pts) { + ff_outlink_set_status(outlink, in->status, in->status_pts); return 0; } - ret = pl_queue_update(s->input.queue, &mix, pl_queue_params( + ret = pl_queue_update(in->queue, &mix, pl_queue_params( .pts = pts * av_q2d(outlink->time_base), .radius = pl_frame_mix_radius(&s->params), .vsync_duration = av_q2d(av_inv_q(outlink->frame_rate)), @@ -980,11 +980,11 @@ static int libplacebo_activate(AVFilterContext *ctx) switch (ret) { case PL_QUEUE_MORE: - ff_inlink_request_frame(inlink); + ff_inlink_request_frame(in->link); return 0; case PL_QUEUE_OK: if (!s->fps.num) - av_fifo_drain2(s->input.out_pts, 1); + av_fifo_drain2(in->out_pts, 1); return output_frame_mix(ctx, &mix, pts); case PL_QUEUE_ERR: return AVERROR_EXTERNAL;