[FFmpeg-devel] Recent API/ABI fix

Stefano Sabatini stefasab at gmail.com
Sat Nov 10 18:23:52 CET 2012

On date Saturday 2012-11-10 11:45:31 +0100, Nicolas George encoded:
> I realize that av_opt_get_key_value(), that I introduced last week, is
> slightly flawed: if the key is omitted, determining what delimiter caused
> the parsing to stop is awkward. This is not severe, but it could be better.
> I wonder how I can make things better. I see a few solution.
> 0. Leave it like that.
> 1. Add a "char *redelim" argument to return the delimiter. This is an API
>    and ABI break.
> 2. Return the delimiter as a positive return value. This is also an API and
>    ABI break since the doc says "0 for success" (some apps may write
>    "if(!ret)" instead of "if(ret < 0)".
> 3. Add a flag to implement 1 (using varargs) or 2.
> 4. Implement av_opt_get_key_value2 and deprecate the first.
> Considering that the function was added officially less than a week ago, I
> think an API/ABI break is acceptable. We may add a rule, and a comment in
> APIchanges, that any API less than a month old is considered still unstable
> and may change without more compatibility quirks than a bump.
> Comments?

I agree that breaking API now should not be considered
severe. Changing the sign should be certainly good, also in general it
is better to return >= in case of success, so that the function can be
extended later and can return as much information as
possible. Regarding the change itself I need to compare it with the
pre-existing function.
FFmpeg = Fundamental and Funny Maxi Portable Ecumenical God

More information about the ffmpeg-devel mailing list