From 564b4591bbe223bdc5f36a1131eaef103f23f5d0 Mon Sep 17 00:00:00 2001 From: Michael Niedermayer Date: Fri, 30 May 2014 21:04:14 +0200 Subject: opt: Add av_opt_copy() MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This includes documentation and other modifications by Lukasz Marek and Martin Storsjö. Signed-off-by: Martin Storsjö --- libavutil/opt.h | 13 +++++++++++++ 1 file changed, 13 insertions(+) (limited to 'libavutil/opt.h') diff --git a/libavutil/opt.h b/libavutil/opt.h index 99d727cad3..906b869d51 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -530,6 +530,19 @@ int av_opt_get_q (void *obj, const char *name, int search_flags, AVRationa * be freed with av_dict_free() by the caller */ int av_opt_get_dict_val(void *obj, const char *name, int search_flags, AVDictionary **out_val); + +/** + * Copy options from src object into dest object. + * + * Options that require memory allocation (e.g. string or binary) are malloc'ed in dest object. + * Original memory allocated for such options is freed unless both src and dest options points to the same memory. + * + * @param dest Object to copy from + * @param src Object to copy into + * @return 0 on success, negative on error + */ +int av_opt_copy(void *dest, const void *src); + /** * @} * @} -- cgit v1.2.3