History

AVOptions: add av_opt_free convenience function.

Anton Khirnov committed 15 years ago

Commit b39b0621 parent 92b4abc4 files · +17 −1Browse files

Unified · Split

4 files
  1. doc/APIchanges +3 −0
  2. libavutil/avutil.h +1 −1
  3. libavutil/opt.c +8 −0
  4. libavutil/opt.h +5 −0
doc/APIchanges+3−0
@@ -13,6 +13,9 @@ libavutil: 2011-04-18 · 12 unmodified lines
1313
1414 API changes, most recent first:
1515
16+2011-06-xx - xxxxxxx - lavu 51.3.0 - opt.h
17+ Add av_opt_free convenience function.
18+
1619 2011-05-28 - 0420bd7 - lavu 51.2.0 - pixdesc.h
1720 Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
1821 avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
libavutil/avutil.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
4040 #define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
4141
4242 #define LIBAVUTIL_VERSION_MAJOR 51
43−#define LIBAVUTIL_VERSION_MINOR 2
43+#define LIBAVUTIL_VERSION_MINOR 3
4444 #define LIBAVUTIL_VERSION_MICRO 0
4545
4646 #define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \
libavutil/opt.c+8−0
@@ -520,6 +520,14 @@ int av_set_options_string(void *ctx, const char *opts, · 519 unmodified lines
520520 return count;
521521 }
522522
523+void av_opt_free(void *obj)
524+{
525+ const AVOption *o = NULL;
526+ while ((o = av_next_option(obj, o)))
527+ if (o->type == FF_OPT_TYPE_STRING || o->type == FF_OPT_TYPE_BINARY)
528+ av_freep((uint8_t *)obj + o->offset);
529+}
530+
523531 #ifdef TEST
524532
525533 #undef printf
libavutil/opt.h+5−0
@@ -176,4 +176,9 @@ void av_opt_set_defaults2(void *s, int mask, int flags); · 175 unmodified lines
176176 int av_set_options_string(void *ctx, const char *opts,
177177 const char *key_val_sep, const char *pairs_sep);
178178
179+/**
180+ * Free all string and binary options in obj.
181+ */
182+void av_opt_free(void *obj);
183+
179184 #endif /* AVUTIL_OPT_H */

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t