summaryrefslogtreecommitdiff
path: root/libavfilter/af_volume.c
diff options
context:
space:
mode:
authorNicolas George <nicolas.george@normalesup.org>2013-03-16 20:54:57 +0100
committerNicolas George <nicolas.george@normalesup.org>2013-03-20 21:13:56 +0100
commite9ca55aeddc41ee692431492572dc862ad3a7db7 (patch)
tree0f8a59078d36781ed7c27ea867b9b874dae97dab /libavfilter/af_volume.c
parente9f45a833d49a4c65caf449741a6f154243ce147 (diff)
lavfi/af_volume: use standard options parsing.
Diffstat (limited to 'libavfilter/af_volume.c')
-rw-r--r--libavfilter/af_volume.c14
1 files changed, 4 insertions, 10 deletions
diff --git a/libavfilter/af_volume.c b/libavfilter/af_volume.c
index 226ef93969..447e8d57fe 100644
--- a/libavfilter/af_volume.c
+++ b/libavfilter/af_volume.c
@@ -59,14 +59,6 @@ AVFILTER_DEFINE_CLASS(volume);
static av_cold int init(AVFilterContext *ctx, const char *args)
{
VolumeContext *vol = ctx->priv;
- static const char *shorthand[] = { "volume", "precision", NULL };
- int ret;
-
- vol->class = &volume_class;
- av_opt_set_defaults(vol);
-
- if ((ret = av_opt_set_from_string(vol, args, shorthand, "=", ":")) < 0)
- return ret;
if (vol->precision == PRECISION_FIXED) {
vol->volume_i = (int)(vol->volume * 256 + 0.5);
@@ -79,8 +71,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args)
precision_str[vol->precision]);
}
- av_opt_free(vol);
- return ret;
+ return 0;
}
static int query_formats(AVFilterContext *ctx)
@@ -299,6 +290,8 @@ static const AVFilterPad avfilter_af_volume_outputs[] = {
{ NULL }
};
+static const char *const shorthand[] = { "volume", "precision", NULL };
+
AVFilter avfilter_af_volume = {
.name = "volume",
.description = NULL_IF_CONFIG_SMALL("Change input volume."),
@@ -308,4 +301,5 @@ AVFilter avfilter_af_volume = {
.inputs = avfilter_af_volume_inputs,
.outputs = avfilter_af_volume_outputs,
.priv_class = &volume_class,
+ .shorthand = shorthand,
};