summaryrefslogtreecommitdiff
path: root/libavutil
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-04-14 09:10:54 +0200
committerAnton Khirnov <anton@khirnov.net>2011-04-29 09:11:46 +0200
commit5a43bd5e2609705ee8b834c789fe93399588ca85 (patch)
tree47911fefbda14fa109eddde4fb05e5a75b62ee96 /libavutil
parent5b81e295931bad4dac0af29333b4e2a203b3f4d4 (diff)
options: simplify av_find_opt by using av_next_option.
Diffstat (limited to 'libavutil')
-rw-r--r--libavutil/opt.c5
1 files changed, 2 insertions, 3 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index f08ed8f068..da7160145f 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -33,10 +33,9 @@
//FIXME order them and do a bin search
const AVOption *av_find_opt(void *v, const char *name, const char *unit, int mask, int flags)
{
- AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass
- const AVOption *o= c->option;
+ const AVOption *o = NULL;
- for (; o && o->name; o++) {
+ while ((o = av_next_option(v, o))) {
if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && (o->flags & mask) == flags)
return o;
}