summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--libavutil/opt.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 65e02135d5..9c601a2cbb 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -573,8 +573,9 @@ const AVOption *av_opt_find(void *obj, const char *name, const char *unit,
return o;
while (o = av_next_option(obj, o)) {
- if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) &&
- (o->flags & opt_flags) == opt_flags)
+ if (!strcmp(o->name, name) && (o->flags & opt_flags) == opt_flags &&
+ ((!unit && o->type != FF_OPT_TYPE_CONST) ||
+ (unit && o->unit && !strcmp(o->unit, unit))))
return o;
}
return NULL;