[FFmpeg-cvslog] lavfi/sine: use standard options parsing.

Clément Bœsch git at videolan.org
Sun Mar 24 12:33:28 CET 2013


ffmpeg | branch: master | Clément Bœsch <ubitux at gmail.com> | Sun Mar 24 08:40:38 2013 +0100| [07b7c2a2175623fb62ac24967089313fd8753924] | committer: Clément Bœsch

lavfi/sine: use standard options parsing.

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

 libavfilter/asrc_sine.c |   10 +++-------
 1 file changed, 3 insertions(+), 7 deletions(-)

diff --git a/libavfilter/asrc_sine.c b/libavfilter/asrc_sine.c
index 82a2bef..148e1ee 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,
 };



More information about the ffmpeg-cvslog mailing list