[FFmpeg-devel] [PATCH] Implement av_set_options_string()

Stefano Sabatini stefano.sabatini-lala
Mon May 11 23:23:01 CEST 2009


On date Sunday 2009-05-10 02:00:52 +0200, Stefano Sabatini encoded:
> On date Sunday 2009-05-10 01:11:33 +0200, Michael Niedermayer encoded:
[...]
> > >  parseutils.c |  139 +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
> > >  parseutils.h |   19 ++++++++
> > >  2 files changed, 158 insertions(+)
> > > b112e8cb0e69efd7091663c8077d454ecb736ecc  parseutils-implement-set-options.patch
> > > Index: libavfilter-soc/ffmpeg/libavfilter/parseutils.c
> > > ===================================================================
> > > --- libavfilter-soc.orig/ffmpeg/libavfilter/parseutils.c	2009-05-06 20:58:43.000000000 +0200
> > > +++ libavfilter-soc/ffmpeg/libavfilter/parseutils.c	2009-05-08 09:03:35.000000000 +0200
> > > @@ -248,10 +248,110 @@
> > >      return 0;
> > >  }
> > >  
> > > +/**
> > > + * Stores the value in the field in ctx that is named like key.
> > > + * ctx must be an AVClass context, storing is done using AVOptions.
> > > + *
> > > + * @param buf the string to parse, buf will be updated to point at the
> > > + * separator just after the parsed key/value pair
> > > + * @param key_val_sep a 0-terminated list of the characters used to
> > > + * separate key from value
> > > + * @param pairs_sep a 0-terminated list of the characters used to
> > > + * separate two pairs from each other
> > 
> > > + * @return 0 if no key/value pair has been found, 1 if a key/value
> > > + * pair has been successfully parsed and set, a negative value
> > > + * otherwise
> > 
> > thats too vague
> > there are many failure modes
> > from parsing failures, over the key being not in the AVOptions list to
> > value not being valid
> 
> Yes, patch updated.

Ping + patch updated with minor fixes in the docs (
a 0-terminated list of *the* characters -> a 0-terminated list of
characters;
0 if key/value pair -> 0 if *the* key/value pair).

Now I wonder if this description:
 * a negative value corresponding to an AVERROR* error code if
 * the key/value pair cannot be parsed, if no matching option exists,
 * or if the value is not valid

is too specific, or if a simple:

 * a negative value corresponding to an AVERROR* error code if
 * the key/value pair is not valid

would be preferable.

Regards.
-- 
FFmpeg = Freak & Funny Mortal Pitiless Ecumenical Governor
-------------- next part --------------
A non-text attachment was scrubbed...
Name: parseutils-implement-set-options.patch
Type: text/x-diff
Size: 6567 bytes
Desc: not available
URL: <http://lists.mplayerhq.hu/pipermail/ffmpeg-devel/attachments/20090511/ce9c7117/attachment.patch>



More information about the ffmpeg-devel mailing list