# HG changeset patch # User stefano # Date 1229290452 0 # Node ID 54ff3a76b7366f5b7ee996c31d7245b0a773ed04 # Parent 678c7604463e6815d313677da651e0edc468a472 Remove set_all_opt() and its use in av_set_string2(). Make av_set_string() and av_set_string2() do not accept as parameter the name of a named constant. This avoids av_set_string2() and av_set_string() to misbehave when there is an option and a named constant with the same name. See the thread: "[PATCH] Remove libavcodec/opt.c:set_all_opt()". diff -r 678c7604463e -r 54ff3a76b736 avcodec.h --- a/avcodec.h Sun Dec 14 20:04:41 2008 +0000 +++ b/avcodec.h Sun Dec 14 21:34:12 2008 +0000 @@ -31,7 +31,7 @@ #define LIBAVCODEC_VERSION_MAJOR 52 #define LIBAVCODEC_VERSION_MINOR 6 -#define LIBAVCODEC_VERSION_MICRO 2 +#define LIBAVCODEC_VERSION_MICRO 3 #define LIBAVCODEC_VERSION_INT AV_VERSION_INT(LIBAVCODEC_VERSION_MAJOR, \ LIBAVCODEC_VERSION_MINOR, \ diff -r 678c7604463e -r 54ff3a76b736 opt.c --- a/opt.c Sun Dec 14 20:04:41 2008 +0000 +++ b/opt.c Sun Dec 14 21:34:12 2008 +0000 @@ -76,24 +76,6 @@ return o; } -static const AVOption *set_all_opt(void *v, const char *unit, double d){ - AVClass *c= *(AVClass**)v; //FIXME silly way of storing AVClass - const AVOption *o= c->option; - const AVOption *ret=NULL; - - for(;o && o->name; o++){ - if(o->type != FF_OPT_TYPE_CONST && o->unit && !strcmp(o->unit, unit)){ - double tmp= d; - if(o->type == FF_OPT_TYPE_FLAGS) - tmp= av_get_int(v, o->name, NULL) | (int64_t)d; - - av_set_number(v, o->name, tmp, 1, 1); - ret= o; - } - } - return ret; -} - static const double const_values[]={ M_PI, M_E, @@ -117,9 +99,6 @@ const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc){ const AVOption *o= av_find_opt(obj, name, NULL, 0, 0); - if(o && o->offset==0 && o->type == FF_OPT_TYPE_CONST && o->unit){ - return set_all_opt(obj, o->unit, o->default_val); - } if(!o || !val || o->offset<=0) return NULL; if(o->type == FF_OPT_TYPE_BINARY){