mirror of https://git.ffmpeg.org/ffmpeg.git
lavfi/avfilter: process options for filters without a private class
It still makes sense to apply AVFilterContext-level options to such filters.
This commit is contained in:
parent
d234b4b193
commit
1c18530e93
|
@ -812,6 +812,7 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
|
||||||
while (*args) {
|
while (*args) {
|
||||||
const char *shorthand = NULL;
|
const char *shorthand = NULL;
|
||||||
|
|
||||||
|
if (ctx->filter->priv_class)
|
||||||
o = av_opt_next(ctx->priv, o);
|
o = av_opt_next(ctx->priv, o);
|
||||||
if (o) {
|
if (o) {
|
||||||
if (o->type == AV_OPT_TYPE_CONST || o->offset == offset)
|
if (o->type == AV_OPT_TYPE_CONST || o->offset == offset)
|
||||||
|
@ -835,7 +836,10 @@ static int process_options(AVFilterContext *ctx, AVDictionary **options,
|
||||||
args++;
|
args++;
|
||||||
if (parsed_key) {
|
if (parsed_key) {
|
||||||
key = parsed_key;
|
key = parsed_key;
|
||||||
while ((o = av_opt_next(ctx->priv, o))); /* discard all remaining shorthand */
|
|
||||||
|
/* discard all remaining shorthand */
|
||||||
|
if (ctx->filter->priv_class)
|
||||||
|
while ((o = av_opt_next(ctx->priv, o)));
|
||||||
} else {
|
} else {
|
||||||
key = shorthand;
|
key = shorthand;
|
||||||
}
|
}
|
||||||
|
@ -904,12 +908,6 @@ int avfilter_init_str(AVFilterContext *filter, const char *args)
|
||||||
int ret = 0;
|
int ret = 0;
|
||||||
|
|
||||||
if (args && *args) {
|
if (args && *args) {
|
||||||
if (!filter->filter->priv_class) {
|
|
||||||
av_log(filter, AV_LOG_ERROR, "This filter does not take any "
|
|
||||||
"options, but options were provided: %s.\n", args);
|
|
||||||
return AVERROR(EINVAL);
|
|
||||||
}
|
|
||||||
|
|
||||||
ret = process_options(filter, &options, args);
|
ret = process_options(filter, &options, args);
|
||||||
if (ret < 0)
|
if (ret < 0)
|
||||||
goto fail;
|
goto fail;
|
||||||
|
|
Loading…
Reference in New Issue