diff options
author | Clément Bœsch <ubitux@gmail.com> | 2013-03-24 11:40:38 +0400 |
---|---|---|
committer | Clément Bœsch <ubitux@gmail.com> | 2013-03-24 15:26:24 +0400 |
commit | 07b7c2a2175623fb62ac24967089313fd8753924 (patch) | |
tree | 8f3c89140ef8b691af690ba0cb7eabcaf94f5fcd /libavfilter | |
parent | 3ac77f67afcdfc941c21d48914d0d5456384bfbf (diff) |
lavfi/sine: use standard options parsing.
Diffstat (limited to 'libavfilter')
-rw-r--r-- | libavfilter/asrc_sine.c | 10 |
1 files changed, 3 insertions, 7 deletions
diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c index 82a2bef64f..148e1ee12e 100644 --- a/libavfilter/asrc_sine.c +++ b/libavfilter/asrc_sine.c @@ -123,14 +123,7 @@ static void make_sin_table(int16_t *sin) static av_cold int init(AVFilterContext *ctx, const char *args) { SineContext *sine = ctx->priv; - static const char *shorthand[] = { "frequency", "beep_factor", NULL }; - int ret; - sine->class = &sine_class; - av_opt_set_defaults(sine); - - if ((ret = av_opt_set_from_string(sine, args, shorthand, "=", ":")) < 0) - return ret; if (!(sine->sin = av_malloc(sizeof(*sine->sin) << LOG_PERIOD))) return AVERROR(ENOMEM); sine->dphi = ldexp(sine->frequency, 32) / sine->sample_rate + 0.5; @@ -217,6 +210,8 @@ static const AVFilterPad sine_outputs[] = { { NULL } }; +static const char *const shorthand[] = { "frequency", "beep_factor", NULL }; + AVFilter avfilter_asrc_sine = { .name = "sine", .description = NULL_IF_CONFIG_SMALL("Generate sine wave audio signal."), @@ -227,4 +222,5 @@ AVFilter avfilter_asrc_sine = { .inputs = NULL, .outputs = sine_outputs, .priv_class = &sine_class, + .shorthand = shorthand, }; |