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
13 13
14API changes, most recent first:14API changes, most recent first:
15 15
162011-06-xx - xxxxxxx - lavu 51.3.0 - opt.h
17 Add av_opt_free convenience function.
18
162011-05-28 - 0420bd7 - lavu 51.2.0 - pixdesc.h192011-05-28 - 0420bd7 - lavu 51.2.0 - pixdesc.h
17 Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate20 Add av_get_pix_fmt_name() in libavutil/pixdesc.h, and deprecate
18 avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.21 avcodec_get_pix_fmt_name() in libavcodec/avcodec.h in its favor.
libavutil/avutil.h+1−1
@@ -40,7 +40,7 @@ · 39 unmodified lines
40#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)40#define AV_VERSION(a, b, c) AV_VERSION_DOT(a, b, c)
41 41
42#define LIBAVUTIL_VERSION_MAJOR 5142#define LIBAVUTIL_VERSION_MAJOR 51
43#define LIBAVUTIL_VERSION_MINOR 243#define LIBAVUTIL_VERSION_MINOR 3
44#define LIBAVUTIL_VERSION_MICRO 044#define LIBAVUTIL_VERSION_MICRO 0
45 45
46#define LIBAVUTIL_VERSION_INT AV_VERSION_INT(LIBAVUTIL_VERSION_MAJOR, \46#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
520 return count;520 return count;
521}521}
522 522
523void 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
523#ifdef TEST531#ifdef TEST
524 532
525#undef printf533#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
176int av_set_options_string(void *ctx, const char *opts,176int av_set_options_string(void *ctx, const char *opts,
177 const char *key_val_sep, const char *pairs_sep);177 const char *key_val_sep, const char *pairs_sep);
178 178
179/**
180 * Free all string and binary options in obj.
181 */
182void av_opt_free(void *obj);
183
179#endif /* AVUTIL_OPT_H */184#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