History

af_volume: switch to an AVOptions-based system.

Anton Khirnov committed 13 years ago

Commit b13623e1 parent dd7fc371 file · +2 −11Browse files

Unified · Split

libavfilter/af_volume.c+2−11
@@ -63,15 +63,6 @@ static const AVClass volume_class = { · 62 unmodified lines
6363 static av_cold int init(AVFilterContext *ctx, const char *args)
6464 {
6565 VolumeContext *vol = ctx->priv;
66− int ret;
67−
68− vol->class = &volume_class;
69− av_opt_set_defaults(vol);
70−
71− if ((ret = av_set_options_string(vol, args, "=", ":")) < 0) {
72− av_log(ctx, AV_LOG_ERROR, "Error parsing options string '%s'.\n", args);
73− return ret;
74− }
7566
7667 if (vol->precision == PRECISION_FIXED) {
7768 vol->volume_i = (int)(vol->volume * 256 + 0.5);
@@ -84,8 +75,7 @@ static av_cold int init(AVFilterContext *ctx, const char *args) · 6 unmodified lines
8475 precision_str[vol->precision]);
8576 }
8677
87− av_opt_free(vol);
88− return ret;
78+ return 0;
8979 }
9080
9181 static int query_formats(AVFilterContext *ctx)
@@ -311,6 +301,7 @@ AVFilter avfilter_af_volume = { · 219 unmodified lines
311301 .description = NULL_IF_CONFIG_SMALL("Change input volume."),
312302 .query_formats = query_formats,
313303 .priv_size = sizeof(VolumeContext),
304+ .priv_class = &volume_class,
314305 .init = init,
315306 .inputs = avfilter_af_volume_inputs,
316307 .outputs = avfilter_af_volume_outputs,

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t