Hi, On Fri, May 27, 2011 at 7:53 PM, Stefano Sabatini <[email protected]> wrote: > +int av_parse_number(double *res, const char *numstr, enum AVParseNumberType > type, > + double min, double max, > + int log_offset, void *log_ctx) > +{ > + ParseUtils parseutils = { &parseutils_class, log_offset, log_ctx }; > + > + char *tail; > + double d = av_strtod(numstr, &tail); > + if ((unsigned)type >= AV_PARSE_NUM_TYPE_NB) { > + av_log(&parseutils, AV_LOG_ERROR, "Unknown parse number type > '%d'\n", type);
This is a little bit of an ugly way to set up a logging context each time this is called. I admit this code isn't performance-critical, just looks a little ... Awkward. Can't we just pass it an existing logging context? The point of the log context is generally not to know where the error occurred (grep -r rocks), but rather to see what object it happened with. Do you plan at some point to have the int/int64/etc. functions not use the double function to get rid of rounding errors potentially introduced by double? Ronald _______________________________________________ libav-devel mailing list [email protected] https://lists.libav.org/mailman/listinfo/libav-devel
