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

Clément Bœsch git at videolan.org
Thu Apr 11 15:40:30 CEST 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Thu Apr 11 15:38:49 2013 +0200| [e2e992c077615efbbb539912f242316bd04faa69] | committer: Clément Bœsch

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

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

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

diff --git a/doc/filters.texi b/doc/filters.texi
index 3b20c80..43de9cc 100644
--- a/doc/filters.texi
+++ b/doc/filters.texi
@@ -902,8 +902,7 @@ The last output packet may contain a different number of samples, as
 the filter will flush all the remaining samples when the input audio
 signal its end.
 
-The filter accepts parameters as a list of @var{key}=@var{value} pairs,
-separated by ":".
+The filter accepts the following options:
 
 @table @option
 
diff --git a/libavfilter/af_asetnsamples.c b/libavfilter/af_asetnsamples.c
index 6ecf5cb..37d3b93 100644
--- a/libavfilter/af_asetnsamples.c
+++ b/libavfilter/af_asetnsamples.c
@@ -45,11 +45,11 @@ typedef struct {
 #define FLAGS AV_OPT_FLAG_AUDIO_PARAM|AV_OPT_FLAG_FILTERING_PARAM
 
 static const AVOption asetnsamples_options[] = {
-{ "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
-{ "p",   "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
-{ "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
-{ "n",              "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
-{ NULL }
+    { "nb_out_samples", "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
+    { "n",              "set the number of per-frame output samples", OFFSET(nb_out_samples), AV_OPT_TYPE_INT, {.i64=1024}, 1, INT_MAX, FLAGS },
+    { "pad", "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+    { "p",   "pad last frame with zeros", OFFSET(pad), AV_OPT_TYPE_INT, {.i64=1}, 0, 1, FLAGS },
+    { NULL }
 };
 
 AVFILTER_DEFINE_CLASS(asetnsamples);
@@ -57,13 +57,6 @@ AVFILTER_DEFINE_CLASS(asetnsamples);
 static av_cold int init(AVFilterContext *ctx, const char *args)
 {
     ASNSContext *asns = ctx->priv;
-    int err;
-
-    asns->class = &asetnsamples_class;
-    av_opt_set_defaults(asns);
-
-    if ((err = av_set_options_string(asns, args, "=", ":")) < 0)
-        return err;
 
     asns->next_out_pts = AV_NOPTS_VALUE;
     av_log(ctx, AV_LOG_VERBOSE, "nb_out_samples:%d pad:%d\n", asns->nb_out_samples, asns->pad);
diff --git a/libavfilter/avfilter.c b/libavfilter/avfilter.c
index cce7bc6..49c7fef 100644
--- a/libavfilter/avfilter.c
+++ b/libavfilter/avfilter.c
@@ -677,7 +677,6 @@ static const char *const filters_left_to_update[] = {
     "aevalsrc",
     "amerge",
     "aresample",
-    "asetnsamples",
     "atempo",
     "buffer",
     "flite",



More information about the ffmpeg-cvslog mailing list