[FFmpeg-devel] [PATCH] Remove libavcodec/opt.c:set_all_opt()

Michael Niedermayer michaelni
Sat Dec 13 22:14:03 CET 2008


On Sun, Dec 07, 2008 at 07:30:44PM +0100, Stefano Sabatini wrote:
> Hi all,
> 
> currently av_set_string2(), if fed with the name of a named constant
> or flag, will look for all the non-constant options with the same unit
> and will set their value to the value of the named constant.
> 
> This permits for example to do tricks of the kind:
> 
> ffmpeg -mv4 foo -> ffmpeg -flags2 +mv4
> ffmpeg -zero bar -> ffmpeg -me_method zero
> 
> The problem with this is that this "feature" isn't reliable, since it
> only works with the *first* constant found, while different named
> constants may have the same name, so the user has to know the options
> array in order to predict the behaviour.
> 
> For example without knowing the options order "ffmpeg -auto 1" may mean:
> 1) ffmpeg -idct auto
> 2) ffmpeg -dct auto
> 3) ffmpeg -aa auto
> 
> Even worse, something like:
> ffmpeg -dct 1
> 
> may be interpreted both as:
> ffmpeg -dct 1
> or
> ffmpeg -cmp_func dct
> 
> (BTW the current code will broke if a named constant is defined
> *before* a parameter with the same name.)
> 
> I propose to remove this feature, this also makes the code smaller and
> simpler.
[...]
> -    if(!o || !val || o->offset<=0)
> +    if((o && o->offset<=0) || !o || !val)

huh?

[...]
-- 
Michael     GnuPG fingerprint: 9FF2128B147EF6730BADF133611EC787040B0FAB

In a rich man's house there is no place to spit but his face.
-- Diogenes of Sinope
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20081213/58f83b03/attachment.pgp>



More information about the ffmpeg-devel mailing list