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
63static av_cold int init(AVFilterContext *ctx, const char *args)63static av_cold int init(AVFilterContext *ctx, const char *args)
64{64{
65 VolumeContext *vol = ctx->priv;65 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 }
75 66
76 if (vol->precision == PRECISION_FIXED) {67 if (vol->precision == PRECISION_FIXED) {
77 vol->volume_i = (int)(vol->volume * 256 + 0.5);68 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
84 precision_str[vol->precision]);75 precision_str[vol->precision]);
85 }76 }
86 77
87 av_opt_free(vol);78 return 0;
88 return ret;
89}79}
90 80
91static int query_formats(AVFilterContext *ctx)81static int query_formats(AVFilterContext *ctx)
@@ -311,6 +301,7 @@ AVFilter avfilter_af_volume = { · 219 unmodified lines
311 .description = NULL_IF_CONFIG_SMALL("Change input volume."),301 .description = NULL_IF_CONFIG_SMALL("Change input volume."),
312 .query_formats = query_formats,302 .query_formats = query_formats,
313 .priv_size = sizeof(VolumeContext),303 .priv_size = sizeof(VolumeContext),
304 .priv_class = &volume_class,
314 .init = init,305 .init = init,
315 .inputs = avfilter_af_volume_inputs,306 .inputs = avfilter_af_volume_inputs,
316 .outputs = avfilter_af_volume_outputs,307 .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