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

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


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

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

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

 doc/filters.texi               |    3 ++-
 libavfilter/avf_showspectrum.c |   15 ---------------
 libavfilter/avfilter.c         |    1 +
 3 files changed, 3 insertions(+), 16 deletions(-)

diff --git a/doc/filters.texi b/doc/filters.texi
index ce4019b..561cdee 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -7033,7 +7033,8 @@ do not have exactly the same duration in the first file.
 Convert input audio to a video output, representing the audio frequency
 spectrum.
 
-The filter accepts the following named parameters:
+The filter accepts the following options:
+
 @table @option
 @item size, s
 Specify the video size for the output. Default value is @code{640x512}.
diff --git a/libavfilter/avf_showspectrum.c b/libavfilter/avf_showspectrum.c
index 364ee6c..058f22c 100644
--- a/libavfilter/avf_showspectrum.c
+++ b/libavfilter/avf_showspectrum.c
@@ -97,20 +97,6 @@ static const struct {
     {    1,                  1,                  0,                   0 }
 };
 
-static av_cold int init(AVFilterContext *ctx, const char *args)
-{
-    ShowSpectrumContext *showspectrum = ctx->priv;
-    int err;
-
-    showspectrum->class = &showspectrum_class;
-    av_opt_set_defaults(showspectrum);
-
-    if ((err = av_set_options_string(showspectrum, args, "=", ":")) < 0)
-        return err;
-
-    return 0;
-}
-
 static av_cold void uninit(AVFilterContext *ctx)
 {
     ShowSpectrumContext *showspectrum = ctx->priv;
@@ -505,7 +491,6 @@ static const AVFilterPad showspectrum_outputs[] = {
 AVFilter avfilter_avf_showspectrum = {
     .name           = "showspectrum",
     .description    = NULL_IF_CONFIG_SMALL("Convert input audio to a spectrum video output."),
-    .init           = init,
     .uninit         = uninit,
     .query_formats  = query_formats,
     .priv_size      = sizeof(ShowSpectrumContext),
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index a731ec5..130fccf 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, "showspectrum") ||
         !strcmp(filter->filter->name, "silencedetect") ||
         !strcmp(filter->filter->name, "thumbnail") ||
 //         !strcmp(filter->filter->name, "scale"      ) ||



More information about the ffmpeg-cvslog mailing list