From patchwork Thu Sep 7 07:42:20 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5019 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1613697jao; Thu, 7 Sep 2017 00:42:47 -0700 (PDT) X-Google-Smtp-Source: ADKCNb67WbQq8lOBOykoH0VmyACJlytQFoLZ+GRQ0ZWU+KAgG3XYcpHXh0OGnuP1jJ892yIavFQg X-Received: by 10.223.184.230 with SMTP id c35mr1273490wrg.313.1504770167580; Thu, 07 Sep 2017 00:42:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504770167; cv=none; d=google.com; s=arc-20160816; b=HhysAVo2YIsUERy+EYKFk67JfcRovLl3HXXWOxQO2nsA3cYp2DHpzIUzNOKkQbPuYJ DviRf7O7BPCBJ0D/gsnnya1xnPZPnoh8oHYk8hJpEeAqtqVrQsfT4SbmaufPnFYjBSrS r4eLWaNXYU13802AEk473o6F85QBuP4+wXrrak1AoKk+5nXhwu2MW/1et8rmfhSdc6Ta gYIzUoH/46/NVqpldlTvgwvO3DacSqblyLCG1YliK86193D7PTeCSz2HC6EM1kcVb+Ie kevMon1aMNhf9SSGSQmTZFx6Mll2XohbBrPwcXYr99iLF0p7X9s1ZLawwgi1wDJnspoF LUWg== 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:reply-to :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:references:in-reply-to:message-id:date :to:from:delivered-to:arc-authentication-results; bh=85uQZ5L6CmPA4nYjcsBQlpbxV7jcVjTSY1KzK3/2HUE=; b=G/cSNo7o72+DMpWitlV2xAOtOiotF1hX/8tHWwv9KX01CMaR1kNe3qG2fpZ7Yxeget IIl1xAawMDAz9WtuOYVldsXMHB/kGtC19yeGO6aY6iAKhz8fwUCYQs55d7Q/qBXSTMhr FO/7nQJ/xWh2JJHWMLOk5D/ufA8PSLwVHdyYnBYfdk3/1SvPutnWlZkdyUfdm2N2t1ct zgCKjI5OwRITRrYBP79H3X+cpqheZ92k66ePuUrR0NriOYHlEoIBfzPaJGncbJK2hwYI B5aSo5QJNMWtDZrOXlrJ15PiGB4NwEGjTIhtnkyG9R9Pd8e5E4ECJVq8eJs3TWS632Fs qb3A== 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 s8si1524361wrf.301.2017.09.07.00.42.47; Thu, 07 Sep 2017 00:42:47 -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 A0AA9688347; Thu, 7 Sep 2017 10:42:31 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from nef2.ens.fr (nef2.ens.fr [129.199.96.40]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id EE0A76879A0 for ; Thu, 7 Sep 2017 10:42:24 +0300 (EEST) Received: from phare.normalesup.org (archicubes.ens.fr [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v877gSo2051217 for ; Thu, 7 Sep 2017 09:42:28 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 2B8A8E00AC; Thu, 7 Sep 2017 09:42:28 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 09:42:20 +0200 Message-Id: <20170907074226.7273-2-george@nsup.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170907074226.7273-1-george@nsup.org> References: <20170907074226.7273-1-george@nsup.org> X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.4.3 (nef2.ens.fr [129.199.96.32]); Thu, 07 Sep 2017 09:42:28 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 2/8] lavfi/af_agate: use helper macros. 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 MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" Signed-off-by: Nicolas George --- libavfilter/af_agate.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libavfilter/af_agate.c b/libavfilter/af_agate.c index f4fcabef93..20905ccb19 100644 --- a/libavfilter/af_agate.c +++ b/libavfilter/af_agate.c @@ -270,10 +270,10 @@ static int activate(AVFilterContext *ctx) { AudioGateContext *s = ctx->priv; AVFrame *out = NULL, *in[2] = { NULL }; - int ret, i, status, nb_samples; + int ret, i, nb_samples; double *dst; - int64_t pts; + FF_FILTER_FORWARD_STATUS_BACK_ALL(ctx->outputs[0], ctx); if ((ret = ff_inlink_consume_frame(ctx->inputs[0], &in[0])) > 0) { av_audio_fifo_write(s->fifo[0], (void **)in[0]->extended_data, in[0]->nb_samples); @@ -321,13 +321,9 @@ static int activate(AVFilterContext *ctx) if (ret < 0) return ret; } - if (ff_inlink_acknowledge_status(ctx->inputs[0], &status, &pts)) { - ff_outlink_set_status(ctx->outputs[0], status, pts); - return 0; - } else if (ff_inlink_acknowledge_status(ctx->inputs[1], &status, &pts)) { - ff_outlink_set_status(ctx->outputs[0], status, pts); - return 0; - } else { + FF_FILTER_FORWARD_STATUS(ctx->inputs[0], ctx->outputs[0]); + FF_FILTER_FORWARD_STATUS(ctx->inputs[1], ctx->outputs[0]); + /* TODO reindent */ if (ff_outlink_frame_wanted(ctx->outputs[0])) { if (!av_audio_fifo_size(s->fifo[0])) ff_inlink_request_frame(ctx->inputs[0]); @@ -335,7 +331,6 @@ static int activate(AVFilterContext *ctx) ff_inlink_request_frame(ctx->inputs[1]); } return 0; - } } static int scquery_formats(AVFilterContext *ctx)