[FFmpeg-devel] [PATCH] lavu/opt: fix av_opt_get_key_value() API.

Nicolas George nicolas.george at normalesup.org
Fri Nov 16 10:54:21 CET 2012


Le quintidi 25 brumaire, an CCXXI, Stefano Sabatini a écrit :
> Nit: NULL

NULL is the name of the pointer. The name of the ASCII control char is NUL,
AFAIK.

> Patch LGTM, thanks.

Ok, finally applied.

> Some more considerations.
> 
> Since there is nothing _opt related it may make sense to move the
> function to parseutils.h or avstring.h.

It is still widely linked to the options default syntax and parser. It does
not matter much I think.

> Also I wonder if it should not return an error in case of empty string
> "" (but it should in case of ":").

I believe the typical use case would be something like:

while (*opts) {
    av_opt_get_key_value(&opts, ...);
}

so the empty string is already handled. For other use cases, testing *opts
before hand is quite easy. And the guarantee that rval is never NULL when
the function succeeds is very useful.

Regards,

-- 
  Nicolas George


More information about the ffmpeg-devel mailing list