[FFmpeg-cvslog] lavfi/silencedetect: switch to an AVOptions-based system.

Clément Bœsch git at videolan.org
Wed Apr 10 23:34:34 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Wed Apr 10 22:05:12 2013 +0200| [1b1688bfc640ab73f05fbe99bfbb400dced5eef6] | committer: Clément Bœsch

lavfi/silencedetect: switch to an AVOptions-based system.

> http://git.videolan.org/gitweb.cgi/ffmpeg.git/?a=commit;h=1b1688bfc640ab73f05fbe99bfbb400dced5eef6
---

 doc/filters.texi               |    2 ++
 libavfilter/af_silencedetect.c |   17 -----------------
 libavfilter/avfilter.c         |    1 +
 3 files changed, 3 insertions(+), 17 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index 11e33e6..ce4019b 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -1117,6 +1117,8 @@ minimum detected noise duration.
 
 The printed times and duration are expressed in seconds.
 
+The filter accepts the following options:
+
 @table @option
 @item duration, d
 Set silence duration until notification (default is 2 seconds).
diff --git a/libavfilter/af_silencedetect.c b/libavfilter/af_silencedetect.c
index dbd9f5f..eb4718b 100644
--- a/libavfilter/af_silencedetect.c
+++ b/libavfilter/af_silencedetect.c
@@ -54,22 +54,6 @@ static const AVOption silencedetect_options[] = {
 
 AVFILTER_DEFINE_CLASS(silencedetect);
 
-static av_cold int init(AVFilterContext *ctx, const char *args)
-{
-    int ret;
-    SilenceDetectContext *silence = ctx->priv;
-
-    silence->class = &silencedetect_class;
-    av_opt_set_defaults(silence);
-
-    if ((ret = av_set_options_string(silence, args, "=", ":")) < 0)
-        return ret;
-
-    av_opt_free(silence);
-
-    return 0;
-}
-
 static char *get_metadata_val(AVFrame *insamples, const char *key)
 {
     AVDictionaryEntry *e = av_dict_get(insamples->metadata, key, NULL, 0);
@@ -176,7 +160,6 @@ AVFilter avfilter_af_silencedetect = {
     .name          = "silencedetect",
     .description   = NULL_IF_CONFIG_SMALL("Detect silence."),
     .priv_size     = sizeof(SilenceDetectContext),
-    .init          = init,
     .query_formats = query_formats,
     .inputs        = silencedetect_inputs,
     .outputs       = silencedetect_outputs,
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index 5fe6f19..a731ec5 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -681,6 +681,7 @@ int avfilter_init_filter(AVFilterContext *filter, const char *args, void *opaque
         !strcmp(filter->filter->name,   "format") ||
         !strcmp(filter->filter->name, "noformat") ||
         !strcmp(filter->filter->name, "resample") ||
+        !strcmp(filter->filter->name, "silencedetect") ||
         !strcmp(filter->filter->name, "thumbnail") ||
 //         !strcmp(filter->filter->name, "scale"      ) ||
         0



More information about the ffmpeg-cvslog mailing list