Commit 3ac77f67 authored by Clément Bœsch's avatar Clément Bœsch

lavfi/apad: use standard options parsing.

parent 4c6f08bd
......@@ -58,17 +58,9 @@ AVFILTER_DEFINE_CLASS(apad);
static av_cold int init(AVFilterContext *ctx, const char *args)
{
int ret;
APadContext *apad = ctx->priv;
apad->class = &apad_class;
apad->next_pts = AV_NOPTS_VALUE;
av_opt_set_defaults(apad);
if ((ret = av_opt_set_from_string(apad, args, NULL, "=", ":")) < 0)
return ret;
if (apad->whole_len && apad->pad_len) {
av_log(ctx, AV_LOG_ERROR, "Both whole and pad length are set, this is not possible\n");
return AVERROR(EINVAL);
......@@ -152,6 +144,8 @@ static const AVFilterPad apad_outputs[] = {
{ NULL },
};
static const char *const shorthand[] = { NULL };
AVFilter avfilter_af_apad = {
.name = "apad",
.description = NULL_IF_CONFIG_SMALL("Pad audio with silence."),
......@@ -160,4 +154,5 @@ AVFilter avfilter_af_apad = {
.inputs = apad_inputs,
.outputs = apad_outputs,
.priv_class = &apad_class,
.shorthand = shorthand,
};
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment