diff options
Diffstat (limited to 'libavutil')
-rw-r--r-- | libavutil/Makefile | 2 | ||||
-rw-r--r-- | libavutil/internal.h | 2 | ||||
-rw-r--r-- | libavutil/opt.c | 8 | ||||
-rw-r--r-- | libavutil/opt.h | 5 |
4 files changed, 14 insertions, 3 deletions
diff --git a/libavutil/Makefile b/libavutil/Makefile index 1386ebb190..01231bd52d 100644 --- a/libavutil/Makefile +++ b/libavutil/Makefile @@ -75,7 +75,7 @@ OBJS-$(ARCH_ARM) += arm/cpu.o OBJS-$(ARCH_PPC) += ppc/cpu.o OBJS-$(ARCH_X86) += x86/cpu.o -TESTPROGS = adler32 aes base64 cpu crc des lls md5 pca sha tree +TESTPROGS = adler32 aes base64 cpu crc des eval lls md5 pca sha tree TESTPROGS-$(HAVE_LZO1X_999_COMPRESS) += lzo DIRS = arm bfin sh4 x86 diff --git a/libavutil/internal.h b/libavutil/internal.h index 51bf40936e..d9ab8e9723 100644 --- a/libavutil/internal.h +++ b/libavutil/internal.h @@ -142,7 +142,6 @@ #define strncpy strncpy_is_forbidden_due_to_security_issues_use_av_strlcpy #undef exit #define exit exit_is_forbidden -#ifndef LIBAVFORMAT_BUILD #undef printf #define printf please_use_av_log_instead_of_printf #undef fprintf @@ -151,7 +150,6 @@ #define puts please_use_av_log_instead_of_puts #undef perror #define perror please_use_av_log_instead_of_perror -#endif #define FF_ALLOC_OR_GOTO(ctx, p, size, label)\ {\ diff --git a/libavutil/opt.c b/libavutil/opt.c index 6b2bc7712d..f3c74a99ec 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 diff --git a/libavutil/opt.h b/libavutil/opt.h index b04c7905d6..c967ed5c6b 100644 --- a/libavutil/opt.h +++ b/libavutil/opt.h @@ -176,4 +176,9 @@ void av_opt_set_defaults2(void *s, int mask, int flags); int av_set_options_string(void *ctx, const char *opts, const char *key_val_sep, const char *pairs_sep); +/** + * Free all string and binary options in obj. + */ +void av_opt_free(void *obj); + #endif /* AVUTIL_OPT_H */ |