[Ffmpeg-devel] [PATCH] Use ff_eval for AVOption parsing
Tue Sep 26 17:28:21 CEST 2006
Panagiotis Issaris said:
> Op dinsdag 26 september 2006 16:43, schreef M?ns Rullg?rd:
>> > Is it okay to commit this one? It does cause some extra output...
>> > ../ffmpeg_g -y -flags +bitexact -dct fastint -idct simple -y -qscale 10 -f
>> > pgmyuv -i vsynth1/%02d.pgm -an -vcodec msmpeg4v2 ./data/a-msmpeg4v2.avi
>> > FFmpeg version SVN-rUNKNOWN, Copyright (c) 2000-2004 Fabrice Bellard
>> > configuration: --enable-gpl --enable-x264 --enable-pthreads
>> > libavutil version: 49.0.1
>> > libavcodec version: 51.15.0
>> > libavformat version: 50.5.0
>> > built on Sep 26 2006 16:07:52, gcc: 4.0.3 (Ubuntu 4.0.3-1ubuntu5)
>> > Parser: missing ( in "bitexact"
>> > Parser: missing ( in "fastint"
>> > Parser: missing ( in "simple"
>> That looks rather bad. Are you sure this is working?
> Yes, it works alright, but it is annoying. The reason it is displaying these
> messages, is that ff_eval does not understand what these are and complains
> about it. The avoptions parsing code parses these, as they are of type
> FF_OPT_TYPE_INT, as "auto", "fastint", etc are shorthands for 0, 1, etc.
> If on the commandline the parameter "-dct simple" is specified, this results
> a call to: av_set_string(x, "dct", "simple")
> As it is an AVOption of type FF_OPT_TYPE_INT, the value will be parsed as if
> was a number (which it could have been). The parser then depends (and has
> always depended) on the failing of this parsing to use the value ("simple") as
> the name of an avoption (you can see this at line 187 of libavcodec/opt.c).
> The thing I'm changing is the replacement of strtod() with ff_eval() so more
> complex expressions can be parsed. The strtod() function does _not_ output
> anything if it can't parse the string it has been given. ff_eval() does, which
> is why these messages are appearing.
I see. Then the warning message should be silenced in these cases.
Unfortunately, I can't immediately think of a nice clean way to do that.
mru at inprovide.com
More information about the ffmpeg-devel