]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/opt.c
Replace Subversion revisions in comments by Git hashes.
[ffmpeg] / libavutil / opt.c
index aa76301740d56d0f49e9354c7445475234a086e2..7c53024d251e7ed8963a275f60f4714d5e5f8436 100644 (file)
@@ -56,9 +56,10 @@ const AVOption *av_next_option(void *obj, const AVOption *last)
 
 const AVOption *av_opt_next(void *obj, const AVOption *last)
 {
-    if (last && last[1].name) return ++last;
-    else if (last)            return NULL;
-    else                      return (*(AVClass**)obj)->option;
+    AVClass *class = *(AVClass**)obj;
+    if (!last && class->option[0].name) return class->option;
+    if (last && last[1].name)           return ++last;
+    return NULL;
 }
 
 static int read_number(const AVOption *o, void *dst, double *num, int *den, int64_t *intnum)