Commit 95030323 authored by Aurelien Jacobs's avatar Aurelien Jacobs

simplify metadata conversion and fixes gcc-2.95 at the same time

Originally committed as revision 17681 to svn://svn.ffmpeg.org/ffmpeg/trunk
parent db794291
...@@ -97,25 +97,23 @@ static void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv, ...@@ -97,25 +97,23 @@ static void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
{ {
/* TODO: use binary search to look up the two conversion tables /* TODO: use binary search to look up the two conversion tables
if the tables are getting big enough that it would matter speed wise */ if the tables are getting big enough that it would matter speed wise */
const AVMetadataConv *s_conv1 = s_conv, *d_conv1 = d_conv, *sc, *dc; const AVMetadataConv *sc, *dc;
AVMetadataTag *mtag = NULL; AVMetadataTag *mtag = NULL;
AVMetadata *dst = NULL; AVMetadata *dst = NULL;
const char *key, *key2; const char *key;
while((mtag=av_metadata_get(*pm, "", mtag, AV_METADATA_IGNORE_SUFFIX))) { while((mtag=av_metadata_get(*pm, "", mtag, AV_METADATA_IGNORE_SUFFIX))) {
key = key2 = mtag->key; key = mtag->key;
if (s_conv != d_conv) { if (s_conv != d_conv) {
if (!s_conv) if (s_conv)
s_conv1 = (const AVMetadataConv[2]){{key,key}}; for (sc=s_conv; sc->native; sc++)
for (sc=s_conv1; sc->native; sc++)
if (!strcasecmp(key, sc->native)) { if (!strcasecmp(key, sc->native)) {
key2 = sc->generic; key = sc->generic;
break; break;
} }
if (!d_conv) if (d_conv)
d_conv1 = (const AVMetadataConv[2]){{key2,key2}}; for (dc=d_conv; dc->native; dc++)
for (dc=d_conv1; dc->native; dc++) if (!strcasecmp(key, dc->generic)) {
if (!strcasecmp(key2, dc->generic)) {
key = dc->native; key = dc->native;
break; break;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment