[FFmpeg-cvslog] Merge commit '85770f2a2651497861ed938efcd0df3696ff5e45'

Stefano Sabatini stefano.sabatini-lala at poste.it
Sun May 1 12:01:35 CEST 2011


On date Sunday 2011-05-01 10:31:12 +1000, Peter Ross wrote:
> On Sun, May 01, 2011 at 02:04:58AM +0200, Stefano Sabatini wrote:
[...]
> > String default value setting doesn't work, that's because
> > av_set_string3() doesn't accept NULL values for val, so for example:
> > 
> > av_set_string3(obj, name, NULL, 1, NULL);
> > 
> > will always return AVERROR(EINVAL).
> > 
> > Here there is a problem since you can't represent a NULL value string
> > with a string safely, you could set "" but that's not the very same
> > thing.
> 
> But you could define a valid string that FFmpeg treats always as NULL.
> 
> e.g.
> 
> avcodec/string.h
> extern const char * av_null_string;
> 
> avutil/string.c
> const char *av_null_string = "(null)";
> 
> av_set_string(..)
> 
>     if (str == av_null_string)
> 
>         behave this way

That's possible, an alternative could be to make av_set_string()
accept the NULL vale for string options.

But this is only part of the problem, when you set options for the
first time you have random values in the context, so you need a
function for initing the context, that is av_opt_set_defaults2() is
not anymore sufficient, you need at least to pass a flag to it for
telling that it has to init the context (and ignore the already
present string fubar values).


More information about the ffmpeg-cvslog mailing list