1
0
mirror of https://github.com/FFmpeg/FFmpeg.git synced 2024-12-23 12:43:46 +02:00

options: simplify av_find_opt by using av_next_option.

This commit is contained in:
Anton Khirnov 2011-04-14 09:10:54 +02:00
parent 5b81e29593
commit 5a43bd5e26

View File

@ -33,10 +33,9 @@
//FIXME order them and do a bin search //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) 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 = NULL;
const AVOption *o= c->option;
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) if (!strcmp(o->name, name) && (!unit || (o->unit && !strcmp(o->unit, unit))) && (o->flags & mask) == flags)
return o; return o;
} }