MCPcopy Create free account
hub / github.com/FFmpeg/FFmpeg / uninit_options

Function uninit_options

fftools/ffmpeg_opt.c:102–136  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

100} GlobalOptionsContext;
101
102static void uninit_options(OptionsContext *o)
103{
104 /* all OPT_SPEC and OPT_TYPE_STRING can be freed in generic way */
105 for (const OptionDef *po = options; po->name; po++) {
106 void *dst;
107
108 if (!(po->flags & OPT_FLAG_OFFSET))
109 continue;
110
111 dst = (uint8_t*)o + po->u.off;
112 if (po->flags & OPT_FLAG_SPEC) {
113 SpecifierOptList *so = dst;
114 for (int i = 0; i < so->nb_opt; i++) {
115 av_freep(&so->opt[i].specifier);
116 if (po->flags & OPT_FLAG_PERSTREAM)
117 stream_specifier_uninit(&so->opt[i].stream_spec);
118 if (po->type == OPT_TYPE_STRING)
119 av_freep(&so->opt[i].u.str);
120 }
121 av_freep(&so->opt);
122 so->nb_opt = 0;
123 } else if (po->type == OPT_TYPE_STRING)
124 av_freep(dst);
125 }
126
127 for (int i = 0; i < o->nb_stream_maps; i++)
128 av_freep(&o->stream_maps[i].linklabel);
129 av_freep(&o->stream_maps);
130
131 for (int i = 0; i < o->nb_attachments; i++)
132 av_freep(&o->attachments[i]);
133 av_freep(&o->attachments);
134
135 av_dict_free(&o->streamid);
136}
137
138static void init_options(OptionsContext *o)
139{

Callers 1

open_filesFunction · 0.85

Calls 3

av_freepFunction · 0.85
stream_specifier_uninitFunction · 0.85
av_dict_freeFunction · 0.85

Tested by

no test coverage detected