[FFmpeg-devel] [PATCH] opt: implement av_opt_set_from_string().

Nicolas George nicolas.george at normalesup.org
Wed Aug 15 11:05:09 CEST 2012

L'octidi 28 thermidor, an CCXX, Stefano Sabatini a écrit :
> > It also does not allow to specify the separators, which was
> > a feature never used anyway.
> Uh? Can you elaborate?

All code in ffmpeg use the same = and : separators. Allowing variable, and
even worse, multiple separators makes the code more complex, and obviously
for a feature that is not needed by ffmpeg.

(External programs may use it, but I am not changing an existing function.)

> Why don't you simply assume pairs_sep? Also this requirement is not
> very robust.

> I'd choose a different strategy, I'd get the token until the option
> separator, and then I'd test for the presence of the key/val
> separator. Seems simpler to me.

The reason for all this awkwardness is to keep compatibility with the
existing parser when it comes to escaping. Currently, the following options


is accepted as "strange=key" and "value". If the whole field is tokenized at
once, it would not be possible.

Note that keys are actually options names, so if we accept to change the
escaping rules, I would go for "no escaping keys", and that would make the
whole code a lot simpler. And, IMHO, more logical, so if anyone backs me up,
I would go straight for it.


  Nicolas George
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 198 bytes
Desc: Digital signature
URL: <http://ffmpeg.org/pipermail/ffmpeg-devel/attachments/20120815/06ef3a74/attachment.asc>

More information about the ffmpeg-devel mailing list