comparison opt.c @ 9640:854368240f7d libavcodec

Provide a context to av_log() calls in av_set_number2() and av_set_string3().
author stefano
date Thu, 14 May 2009 18:43:43 +0000
parents e9d9d946f213
children 04d77f7cc7fd
comparison
equal deleted inserted replaced
9639:ccb862ffe15a 9640:854368240f7d
54 *o_out= o; 54 *o_out= o;
55 if(!o || o->offset<=0) 55 if(!o || o->offset<=0)
56 return AVERROR(ENOENT); 56 return AVERROR(ENOENT);
57 57
58 if(o->max*den < num*intnum || o->min*den > num*intnum) { 58 if(o->max*den < num*intnum || o->min*den > num*intnum) {
59 av_log(NULL, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name); 59 av_log(obj, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);
60 return AVERROR(ERANGE); 60 return AVERROR(ERANGE);
61 } 61 }
62 62
63 dst= ((uint8_t*)obj) + o->offset; 63 dst= ((uint8_t*)obj) + o->offset;
64 64
166 else if(!strcmp(buf, "min" )) d= o->min; 166 else if(!strcmp(buf, "min" )) d= o->min;
167 else if(!strcmp(buf, "none" )) d= 0; 167 else if(!strcmp(buf, "none" )) d= 0;
168 else if(!strcmp(buf, "all" )) d= ~0; 168 else if(!strcmp(buf, "all" )) d= ~0;
169 else { 169 else {
170 if (error) 170 if (error)
171 av_log(NULL, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error); 171 av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error);
172 return AVERROR(EINVAL); 172 return AVERROR(EINVAL);
173 } 173 }
174 } 174 }
175 if(o->type == FF_OPT_TYPE_FLAGS){ 175 if(o->type == FF_OPT_TYPE_FLAGS){
176 if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d; 176 if (cmd=='+') d= av_get_int(obj, name, NULL) | (int64_t)d;