summaryrefslogtreecommitdiff
path: root/libavutil/opt.c
diff options
context:
space:
mode:
authorAnton Khirnov <anton@khirnov.net>2011-06-05 13:17:26 +0200
committerAnton Khirnov <anton@khirnov.net>2011-06-05 15:01:36 +0200
commitb39b06233dfd69b941a32f29171dfb63abb23c06 (patch)
tree28c0c642138802b15123b48b95ac2eea22b63831 /libavutil/opt.c
parent92b4abc2ad88ac7e89a60480094b8398fe1b8dbf (diff)
AVOptions: add av_opt_free convenience function.
Diffstat (limited to 'libavutil/opt.c')
-rw-r--r--libavutil/opt.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/libavutil/opt.c b/libavutil/opt.c
index 4e25918ed1..172fcec456 100644
--- a/libavutil/opt.c
+++ b/libavutil/opt.c
@@ -520,6 +520,14 @@ int av_set_options_string(void *ctx, const char *opts,
return count;
}
+void av_opt_free(void *obj)
+{
+ const AVOption *o = NULL;
+ while ((o = av_next_option(obj, o)))
+ if (o->type == FF_OPT_TYPE_STRING || o->type == FF_OPT_TYPE_BINARY)
+ av_freep((uint8_t *)obj + o->offset);
+}
+
#ifdef TEST
#undef printf