diff options
author | Rodger Combs <rodger.combs@gmail.com> | 2015-09-21 04:16:58 -0500 |
---|---|---|
committer | Rodger Combs <rodger.combs@gmail.com> | 2015-10-09 04:12:57 -0500 |
commit | 0562f959021514a6697601e5b3e0690f41c06f4e (patch) | |
tree | 23b61f38ae3f3b18e19a2ee3de3f82667e706bdd /libavutil/opt.h | |
parent | f36baeebc55d326b0a665b3e3e91792aa81102b7 (diff) | |
download | ffmpeg-0562f959021514a6697601e5b3e0690f41c06f4e.tar.gz |
lavu/opt: add flag to return NULL when applicable in av_opt_get
Signed-off-by: Michael Niedermayer <michael@niedermayer.cc>
Diffstat (limited to 'libavutil/opt.h')
-rw-r--r-- | libavutil/opt.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/libavutil/opt.h b/libavutil/opt.h index ef90e9c87a..753434d628 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -564,6 +564,12 @@ int av_opt_eval_q (void *obj, const AVOption *o, const char *val, AVRational #define AV_OPT_SEARCH_FAKE_OBJ (1 << 1) /** + * In av_opt_get, return NULL if the option has a pointer type and is set to NULL, + * rather than returning an empty string. + */ +#define AV_OPT_ALLOW_NULL (1 << 2) + +/** * Allows av_opt_query_ranges and av_opt_query_ranges_default to return more than * one component for certain option types. * @see AVOptionRanges for details. @@ -722,6 +728,10 @@ int av_opt_set_dict_val(void *obj, const char *name, const AVDictionary *val, in */ /** * @note the returned string will be av_malloc()ed and must be av_free()ed by the caller + * + * @note if AV_OPT_ALLOW_NULL is set in search_flags in av_opt_get, and the option has + * AV_OPT_TYPE_STRING or AV_OPT_TYPE_BINARY and is set to NULL, *out_val will be set + * to NULL instead of an allocated empty string. */ int av_opt_get (void *obj, const char *name, int search_flags, uint8_t **out_val); int av_opt_get_int (void *obj, const char *name, int search_flags, int64_t *out_val); |