aboutsummaryrefslogtreecommitdiffstats
path: root/libavcodec/opt.c
diff options
context:
space:
mode:
authorStefano Sabatini <stefano.sabatini-lala@poste.it>2008-12-14 21:34:12 +0000
committerStefano Sabatini <stefano.sabatini-lala@poste.it>2008-12-14 21:34:12 +0000
commit54c441c8607634ccce44da1c7c230671cf635f67 (patch)
tree8407e7e951705ab3d74b72940ba45d88dd64e527 /libavcodec/opt.c
parenta3bb564ee5d9d6bdd38a7ee76985e35f1be1184a (diff)
downloadffmpeg-54c441c8607634ccce44da1c7c230671cf635f67.tar.gz
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()". Originally committed as revision 16134 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavcodec/opt.c')
-rw-r--r--libavcodec/opt.c21
1 files changed, 0 insertions, 21 deletions
diff --git a/libavcodec/opt.c b/libavcodec/opt.c
index bc2f3bdd74..e1fb1e00d1 100644
--- a/libavcodec/opt.c
+++ b/libavcodec/opt.c
@@ -76,24 +76,6 @@ static const AVOption *av_set_number(void *obj, const char *name, double num, in
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 @@ static int hexchar2int(char c) {
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){