| 100 | } GlobalOptionsContext; |
| 101 | |
| 102 | static 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 | |
| 138 | static void init_options(OptionsContext *o) |
| 139 | { |
no test coverage detected