]> git.sesse.net Git - ffmpeg/blobdiff - libavutil/opt.c
ffplay: increase log level of the message issued when the stream frame size changes
[ffmpeg] / libavutil / opt.c
index 60fc307c0e95f718e908886b6d50a6f0f8572025..e56cdc65e71bb09b07ecc14383b07b182ed2a79f 100644 (file)
@@ -229,7 +229,7 @@ const AVOption *av_set_int(void *obj, const char *name, int64_t n)
  */
 const char *av_get_string(void *obj, const char *name, const AVOption **o_out, char *buf, int buf_len)
 {
-    const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
+    const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN);
     void *dst;
     uint8_t *bin;
     int len, i;
@@ -262,7 +262,7 @@ const char *av_get_string(void *obj, const char *name, const AVOption **o_out, c
 
 static int av_get_number(void *obj, const char *name, const AVOption **o_out, double *num, int *den, int64_t *intnum)
 {
-    const AVOption *o = av_opt_find(obj, name, NULL, 0, 0);
+    const AVOption *o = av_opt_find(obj, name, NULL, 0, AV_OPT_SEARCH_CHILDREN);
     void *dst;
     if (!o || (o->offset<=0 && o->type != FF_OPT_TYPE_CONST))
         goto error;
@@ -575,8 +575,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;