From patchwork Thu Aug 31 18:04:23 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Nicolas George X-Patchwork-Id: 4925 Delivered-To: ffmpegpatchwork@gmail.com Received: by 10.2.15.201 with SMTP id 70csp1843880jao; Thu, 31 Aug 2017 11:04:47 -0700 (PDT) X-Google-Smtp-Source: ADKCNb7Wuowv8aCFjv3gXae47ZtLYBHEuAd0OrG34GUYNsVbcs2tMmlM2vjMiV4Gzn7eAkX8be5R X-Received: by 10.223.186.1 with SMTP id o1mr3940509wrg.236.1504202687413; Thu, 31 Aug 2017 11:04:47 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1504202687; cv=none; d=google.com; s=arc-20160816; b=A4gj/HmqFjHVBU1L//N0D8Im701qWOBjmThuTimZ9CYe3GzigdYe3NsRgPYgEeRsvp 8YdN6xwgn8ik09WKzMu0cecR5NSCEmH3UnMNAWJQREHyXymubkR6g8LADiAG4jej/KaF D3Lra2/fLdA3k1Y9bPeHU6bJNP5LtfpXE6PUHFKaQosQPGrOyg0mnyuV5OlfenqbbXYb oKRJD7ZG+K8daScte36S5RqhWgkKcraSiFsVJi2cOm69YGSx9JkhKvP9L7AbXnvJlsqU SMMbyb/zIBen6C3ZVZHEEClHgMdLLpj++kR8zJdopN1JfS2OcFA7WTNmGMUmDFoU1vPm c3Qw== 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=mD1nWVaMKxetjUXnAt/M3r+xjH8TnF/UwjQdvMHCbvoDtFSry8W9gqO2jllwPlZ9eW 1FEzyJyerphNw4AWeK2zppd1JI7Idsdv/+CIg4M2nm98H+OIuR+XqcHRXiAPR/TxogQE WOSu3YFVb/mPOYdx4XpnzeSudXJO8nVDpebPeTtiJhWtP2G39OA9A/lnQuVdGdPG6pUz 791jMm9beA4QcM9YZCuRhLWlY85zgZKdcGTOZXpY0LFtlJJtlimmm1P461vbPxdfNbRn Kq6SEVYxb11l8qhr7X2wYt644BzWwxtRhtY5gB+yHGFnuoR4GCAJRyGqx8hhJ51uU4UA xMOw== 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 c27si206230wrg.543.2017.08.31.11.04.46; Thu, 31 Aug 2017 11:04: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 F22A868A069; Thu, 31 Aug 2017 21:04:35 +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 52DB1680112 for ; Thu, 31 Aug 2017 21:04:28 +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 v7VI4Sa5069623 for ; Thu, 31 Aug 2017 20:04:29 +0200 (CEST) Received: by phare.normalesup.org (Postfix, from userid 1001) id C8018E96BC; Thu, 31 Aug 2017 20:04:28 +0200 (CEST) From: Nicolas George To: ffmpeg-devel@ffmpeg.org Date: Thu, 31 Aug 2017 20:04:23 +0200 Message-Id: <20170831180427.32102-2-george@nsup.org> X-Mailer: git-send-email 2.14.1 In-Reply-To: <20170831180427.32102-1-george@nsup.org> References: <20170831180427.32102-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, 31 Aug 2017 20:04:29 +0200 (CEST) Subject: [FFmpeg-devel] [PATCH 2/6] 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)