*/
/**
- * @file opt.c
+ * @file libavcodec/opt.c
* AVOptions
* @author Michael Niedermayer <michaelni@gmx.at>
*/
return AVERROR(ENOENT);
if(o->max*den < num*intnum || o->min*den > num*intnum) {
- av_log(NULL, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);
+ av_log(obj, AV_LOG_ERROR, "Value %lf for parameter '%s' out of range\n", num, name);
return AVERROR(ERANGE);
}
else if(!strcmp(buf, "all" )) d= ~0;
else {
if (error)
- av_log(NULL, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error);
+ av_log(obj, AV_LOG_ERROR, "Unable to parse option value \"%s\": %s\n", val, error);
return AVERROR(EINVAL);
}
}
return 0;
}
+#if LIBAVCODEC_VERSION_MAJOR < 53
const AVOption *av_set_string2(void *obj, const char *name, const char *val, int alloc){
const AVOption *o;
if (av_set_string3(obj, name, val, alloc, &o) < 0)
return NULL;
return o;
}
+#endif
const AVOption *av_set_double(void *obj, const char *name, double n){
return av_set_number(obj, name, n, 1, 1);
break;
case FF_OPT_TYPE_INT64:
if((double)(opt->default_val+0.6) == opt->default_val)
- av_log(s, AV_LOG_DEBUG, "loss of precission in default of %s\n", opt->name);
+ av_log(s, AV_LOG_DEBUG, "loss of precision in default of %s\n", opt->name);
av_set_int(s, opt->name, opt->default_val);
break;
case FF_OPT_TYPE_FLOAT: {