From patchwork Mon Sep 30 13:36:47 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Lance Wang X-Patchwork-Id: 15418 Return-Path: X-Original-To: patchwork@ffaux-bg.ffmpeg.org Delivered-To: patchwork@ffaux-bg.ffmpeg.org Received: from ffbox0-bg.mplayerhq.hu (ffbox0-bg.ffmpeg.org [79.124.17.100]) by ffaux.localdomain (Postfix) with ESMTP id 2120F447DB9 for ; Mon, 30 Sep 2019 16:37:12 +0300 (EEST) Received: from [127.0.1.1] (localhost [127.0.0.1]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTP id 030856899BB; Mon, 30 Sep 2019 16:37:12 +0300 (EEST) X-Original-To: ffmpeg-devel@ffmpeg.org Delivered-To: ffmpeg-devel@ffmpeg.org Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by ffbox0-bg.mplayerhq.hu (Postfix) with ESMTPS id 6495C6899EB for ; Mon, 30 Sep 2019 16:37:05 +0300 (EEST) Received: by mail-pf1-f196.google.com with SMTP id q10so5654597pfl.0 for ; Mon, 30 Sep 2019 06:37:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=IUZRXykUQSAJdovCA0ut9pGVED5zpYtbtsdobZaNVic=; b=fwU59dDynZoHQlrqHu9wgGunRLI0Gm64GAfXoQuOltptDJ9dpapvdLRBrc5p5KrUBY SYnmobkCT241aY9PiTaLLqZUPsILFNqn5m1x2bqXCkZmYfe6EXRr4d29sduls6TC6dEJ OgItWho6jfV2B6A5kSyG1dJOcWCRJWBl9/YXyEJFc9c1T+mTAdfPpw93pk4GUHTxWnOd yN5vXRakF/msBokwicoRbiUjpNvfTHQnZtDjjDtT0s4UrPf2qdm8iay1AL3/uYdWXqfh YBhPbqSdeeYrKPwQc1gvxNm4HnaDayrJQAVxpnklzM42NxVWndGdaM+e2136/oj2sDDR PO/A== 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; bh=IUZRXykUQSAJdovCA0ut9pGVED5zpYtbtsdobZaNVic=; b=XXg1ddQHzk2KFty49AMyQoPb/gYf1Tr81lP+LRjpHuS71N1RDSuLnlvkO4bpSqNl36 lGXYQRMUnc2Mm1l9v8y2xdSm+z2FkunTVYf9Mz1aQqYngO6VeBV8twZ290AMBmnKcGV2 ksQnq+X1NAWpDYtBc+M3xsQCstKLYXvJXLdSfWwtEbjoM741oeTQNQvDvvI5EWbxehg0 Wx9BaMyg9JW1E9dEvlwBLHXdpFI4RRtUfjFJH0P3DF9PwFLjcugecRSxu8WMyBhlQOsl LMtjhG0rzM3+IHUIP+Mewp9ahmHTYkFZ/bODUyW+C59a12G4dTbusgffc01NKLJxk1MS ft7g== X-Gm-Message-State: APjAAAVFPRcx5yniPUtm8qooXOIsF5Tfbr2Sb5BPfGZCNK/oYTIHBUUa 8KDhWVbH3kCmkJBgIv28jarlk1fH X-Google-Smtp-Source: APXvYqwboaOei6p7lfVlqpDGMf1xoPL3AOK0SdShzAqbmQuckdqSqNHUh4/DL4nPW0JuqftYCQRMvg== X-Received: by 2002:a62:f244:: with SMTP id y4mr21918239pfl.2.1569850623684; Mon, 30 Sep 2019 06:37:03 -0700 (PDT) Received: from vpn.localdomain ([47.90.99.151]) by smtp.gmail.com with ESMTPSA id x6sm20188809pfd.53.2019.09.30.06.37.02 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Mon, 30 Sep 2019 06:37:03 -0700 (PDT) From: lance.lmwang@gmail.com To: ffmpeg-devel@ffmpeg.org Date: Mon, 30 Sep 2019 21:36:47 +0800 Message-Id: <20190930133647.6290-6-lance.lmwang@gmail.com> X-Mailer: git-send-email 2.9.5 In-Reply-To: <20190930133647.6290-1-lance.lmwang@gmail.com> References: <20190930133647.6290-1-lance.lmwang@gmail.com> Subject: [FFmpeg-devel] [PATCH v1 6/6] avfilter/af_silenceremove: remove duplicate option fields 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: Limin Wang MIME-Version: 1.0 Errors-To: ffmpeg-devel-bounces@ffmpeg.org Sender: "ffmpeg-devel" From: Limin Wang Signed-off-by: Limin Wang --- libavfilter/af_silenceremove.c | 20 ++++++++------------ 1 file changed, 8 insertions(+), 12 deletions(-) diff --git a/libavfilter/af_silenceremove.c b/libavfilter/af_silenceremove.c index 7d76e49..c85be81 100644 --- a/libavfilter/af_silenceremove.c +++ b/libavfilter/af_silenceremove.c @@ -55,18 +55,14 @@ typedef struct SilenceRemoveContext { int start_periods; int64_t start_duration; - int64_t start_duration_opt; double start_threshold; int64_t start_silence; - int64_t start_silence_opt; int start_mode; int stop_periods; int64_t stop_duration; - int64_t stop_duration_opt; double stop_threshold; int64_t stop_silence; - int64_t stop_silence_opt; int stop_mode; double *start_holdoff; @@ -105,16 +101,16 @@ typedef struct SilenceRemoveContext { static const AVOption silenceremove_options[] = { { "start_periods", NULL, OFFSET(start_periods), AV_OPT_TYPE_INT, {.i64=0}, 0, 9000, AF }, - { "start_duration", "set start duration of non-silence part", OFFSET(start_duration_opt), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, + { "start_duration", "set start duration of non-silence part", OFFSET(start_duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, { "start_threshold", "set threshold for start silence detection", OFFSET(start_threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, DBL_MAX, AF }, - { "start_silence", "set start duration of silence part to keep", OFFSET(start_silence_opt), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, + { "start_silence", "set start duration of silence part to keep", OFFSET(start_silence), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, { "start_mode", "set which channel will trigger trimming from start", OFFSET(start_mode), AV_OPT_TYPE_INT, {.i64=T_ANY}, T_ANY, T_ALL, AF, "mode" }, { "any", 0, 0, AV_OPT_TYPE_CONST, {.i64=T_ANY}, 0, 0, AF, "mode" }, { "all", 0, 0, AV_OPT_TYPE_CONST, {.i64=T_ALL}, 0, 0, AF, "mode" }, { "stop_periods", NULL, OFFSET(stop_periods), AV_OPT_TYPE_INT, {.i64=0}, -9000, 9000, AF }, - { "stop_duration", "set stop duration of non-silence part", OFFSET(stop_duration_opt), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, + { "stop_duration", "set stop duration of non-silence part", OFFSET(stop_duration), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, { "stop_threshold", "set threshold for stop silence detection", OFFSET(stop_threshold), AV_OPT_TYPE_DOUBLE, {.dbl=0}, 0, DBL_MAX, AF }, - { "stop_silence", "set stop duration of silence part to keep", OFFSET(stop_silence_opt), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, + { "stop_silence", "set stop duration of silence part to keep", OFFSET(stop_silence), AV_OPT_TYPE_DURATION, {.i64=0}, 0, INT64_MAX, AF }, { "stop_mode", "set which channel will trigger trimming from end", OFFSET(stop_mode), AV_OPT_TYPE_INT, {.i64=T_ANY}, T_ANY, T_ALL, AF, "mode" }, { "detection", "set how silence is detected", OFFSET(detection), AV_OPT_TYPE_INT, {.i64=D_RMS}, D_PEAK,D_RMS, AF, "detection" }, { "peak", "use absolute values of samples", 0, AV_OPT_TYPE_CONST, {.i64=D_PEAK},0, 0, AF, "detection" }, @@ -214,13 +210,13 @@ static int config_input(AVFilterLink *inlink) clear_window(s); - s->start_duration = av_rescale(s->start_duration_opt, inlink->sample_rate, + s->start_duration = av_rescale(s->start_duration, inlink->sample_rate, AV_TIME_BASE); - s->start_silence = av_rescale(s->start_silence_opt, inlink->sample_rate, + s->start_silence = av_rescale(s->start_silence, inlink->sample_rate, AV_TIME_BASE); - s->stop_duration = av_rescale(s->stop_duration_opt, inlink->sample_rate, + s->stop_duration = av_rescale(s->stop_duration, inlink->sample_rate, AV_TIME_BASE); - s->stop_silence = av_rescale(s->stop_silence_opt, inlink->sample_rate, + s->stop_silence = av_rescale(s->stop_silence, inlink->sample_rate, AV_TIME_BASE); s->start_holdoff = av_malloc_array(FFMAX(s->start_duration, 1),