diff options
author | Clément Bœsch <u@pkh.me> | 2018-04-22 16:30:19 +0200 |
---|---|---|
committer | Clément Bœsch <u@pkh.me> | 2018-04-26 19:50:29 +0200 |
commit | 5be0410cb31cd27ce5b518b0eca942ec90af5f34 (patch) | |
tree | f0682b623833f2cecd922f0089ebc58103ce5e47 /libavutil/opt.c | |
parent | 71fa82bed62f812d30aee26f3c6385e2ec890ebb (diff) | |
download | ffmpeg-5be0410cb31cd27ce5b518b0eca942ec90af5f34.tar.gz |
lavu/opt: add AV_OPT_FLAG_DEPRECATED
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r-- | libavutil/opt.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c index 3b0aab4ee8..99282605f5 100644 --- a/libavutil/opt.c +++ b/libavutil/opt.c @@ -463,6 +463,9 @@ int av_opt_set(void *obj, const char *name, const char *val, int search_flags) if (o->flags & AV_OPT_FLAG_READONLY) return AVERROR(EINVAL); + if (o->flags & AV_OPT_FLAG_DEPRECATED) + av_log(obj, AV_LOG_WARNING, "The \"%s\" option is deprecated: %s\n", name, o->help); + dst = ((uint8_t *)target_obj) + o->offset; switch (o->type) { case AV_OPT_TYPE_BOOL: @@ -759,6 +762,9 @@ int av_opt_get(void *obj, const char *name, int search_flags, uint8_t **out_val) if (!o || !target_obj || (o->offset<=0 && o->type != AV_OPT_TYPE_CONST)) return AVERROR_OPTION_NOT_FOUND; + if (o->flags & AV_OPT_FLAG_DEPRECATED) + av_log(obj, AV_LOG_WARNING, "The \"%s\" option is deprecated: %s\n", name, o->help); + dst = (uint8_t *)target_obj + o->offset; buf[0] = 0; |