From patchwork Thu Sep 7 07:42:21 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 5017 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1613820jao; Thu, 7 Sep 2017 00:42:57 -0700 (PDT) X-Google-Smtp-Source: ADKCNb50XJF990tpDc8Sb6PpAmq9VvQ80o0JEuU0+Vbu25CrG8NXBg1uM9ptB0txm3s1Fn+IdkTR X-Received: by 10.223.150.239 with SMTP id u102mr1348533wrb.245.1504770177630; Thu, 07 Sep 2017 00:42:57 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504770177; cv=none; d=google.com; s=arc-20160816; b=Ye6c+lx0fLu58BLmRcsvItSLb/ngOi2oneUTOSdvOUWT+f9aJlYFmRXMS1ztWBWmXW PQiw9KdacfBadWnvyMaBo079MR3zCHTe1/VCixud0x39K5z65wPg/JKBxUPhpUIewNRd vBZylsIyoKxWFI4zBLba8psNKm+okDWA/elMZWi4ExQ2BxB+RqHVVqBAUHR3jI5Aplg4 9z9V+BJEf7jZYgCQUxAfmpVFnxTTo5HkMGgpG4a8iG1dglaMcyzQE7uagtGnplW+a+Bm 5WbVYMnDKE61nFcwbPHnD4oMPKAqZ2NwD4TtkCG7EXfl7zX2Dv1lhpPH3foeYrEhl7Ud La+g== 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=IDTI19Dfhhihlo9xCIPA7q8Jg4TBN92kAaVPfL5EWKI=; b=rSbpHffi/kfoZ4O2GQT4QufpyduLBypZkcjib6Y6nEw8xIHk1+bk/L+BG1Y9GllE6t s+smWrVHLMy5HtNoU/23Ox7SfTrG+mTyXusnJeaE8m3/YlzVZRGQVCQ81Xnhim1X0tM4 kQletjpGR/pH/gKvN5nlmw90qQ6E0tQh6C6P/O8wotG1RSKFAnFE4lmCOhemmA1xwQGR JTbrzlB2q2YXNNOd65Jpt8YirRep25XYM6P9l2bmMb1GX9nCDGFYeyg3kYNiQ7Vc9av8 Z8V7IzTyX+jrvn2Ek9+whETONFYqDqo6V28GXau9cYPs0Hj4AWdNgdTmi2Yb1apRYErC 0dtQ== 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 x73si686401wma.262.2017.09.07.00.42.57; Thu, 07 Sep 2017 00:42:57 -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 EFDF6688393; 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 640986879A0 for ; Thu, 7 Sep 2017 10:42:25 +0300 (EEST) Received: from phare.normalesup.org (phare.normalesup.org [129.199.129.80]) by nef2.ens.fr (8.13.6/1.01.28121999) with ESMTP id v877gS2J051225 for ; Thu, 7 Sep 2017 09:42:28 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id 9389AE00AB; Thu, 7 Sep 2017 09:42:28 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 7 Sep 2017 09:42:21 +0200 Message-Id: <20170907074226.7273-3-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 3/8] lavfi/af_sidechaincompress: 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_sidechaincompress.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) diff --git a/libavfilter/af_sidechaincompress.c b/libavfilter/af_sidechaincompress.c index f174b70a5b..55bed43844 100644 --- a/libavfilter/af_sidechaincompress.c +++ b/libavfilter/af_sidechaincompress.c @@ -188,10 +188,10 @@ static int activate(AVFilterContext *ctx) { SidechainCompressContext *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); @@ -239,13 +239,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]); @@ -253,7 +249,6 @@ static int activate(AVFilterContext *ctx) ff_inlink_request_frame(ctx->inputs[1]); } return 0; - } } static int query_formats(AVFilterContext *ctx)