AVOptions: add av_opt_free convenience function.

This commit is contained in:
Anton Khirnov
2011-06-05 13:17:26 +02:00
parent 92b4abc2ad
commit b39b06233d
4 changed files with 17 additions and 1 deletions

View File

@@ -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