[FFmpeg-devel] [PATCH] Enhance libavcodec/opt.c API
Sun May 11 22:49:37 CEST 2008
On date Sunday 2008-05-11 19:09:02 +0200, Michael Niedermayer encoded:
> On Sun, May 11, 2008 at 06:08:06PM +0200, Stefano Sabatini wrote:
> > Hi all,
> > one of the main problems with the AVOption API is that it is
> > impossible to distinguish when setting an option value if an option is
> > simply not present in a context, or the provided value is wrong.
> > This proposal adds a function named av_set_opt_string() which takes as
> > parameter the pointer to the option to be set, this solution could
> > eventually be extended to the other av_set_* and av_get_* functions
> > (also improving efficiency in many cases).
> > In this way you can check for the presence of an option with
> > av_opt_find(), then use the av_set_opt_string() function on the found
> > option to set its value, if the value provided is wrong then it will
> > return NULL.
> patch rejected
Please could you elaborate more on this (I'm just wondering which
obvious thing I missed this time).
Anyway current behavior of ffmpeg:opt_default() (which depends on the current
limitation of opt.c API) sucks, for example:
$ ffmpeg -b foo
Must supply at least one output file
$ ffmpeg -flags bar
ffmpeg: unrecognized option '-flags'
FFmpeg = Foolish & Friendly MultiPurpose EnGraver
More information about the ffmpeg-devel