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

Function metadata_conv

libavformat/metadata.c:110–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

108}
109
110void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
111 const AVMetadataConv *s_conv)
112{
113 /* TODO: use binary search to look up the two conversion tables
114 if the tables are getting big enough that it would matter speed wise */
115 const AVMetadataConv *sc, *dc;
116 AVMetadataTag *mtag = NULL;
117 AVMetadata *dst = NULL;
118 const char *key;
119
120 while((mtag=av_metadata_get(*pm, "", mtag, AV_METADATA_IGNORE_SUFFIX))) {
121 key = mtag->key;
122 if (s_conv != d_conv) {
123 if (s_conv)
124 for (sc=s_conv; sc->native; sc++)
125 if (!strcasecmp(key, sc->native)) {
126 key = sc->generic;
127 break;
128 }
129 if (d_conv)
130 for (dc=d_conv; dc->native; dc++)
131 if (!strcasecmp(key, dc->generic)) {
132 key = dc->native;
133 break;
134 }
135 }
136 av_metadata_set2(&dst, key, mtag->value, 0);
137 }
138 av_metadata_free(pm);
139 *pm = dst;
140}
141
142void av_metadata_conv(AVFormatContext *ctx, const AVMetadataConv *d_conv,
143 const AVMetadataConv *s_conv)

Callers 2

av_write_headerFunction · 0.85
av_metadata_convFunction · 0.85

Calls 3

av_metadata_getFunction · 0.85
av_metadata_set2Function · 0.85
av_metadata_freeFunction · 0.85

Tested by

no test coverage detected