summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-03-01 14:29:30 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-03-01 14:29:30 +0000
commit95030323d1e287abb9b90959fa5111a0aa0f55e2 (patch)
tree78d0ba21d69e5ae05b8dc44a277967c14ddd9790
parentdb794291a29546b93c3b39dc33b3f9a3bcf9e315 (diff)
downloadffmpeg-95030323d1e287abb9b90959fa5111a0aa0f55e2.tar.gz
simplify metadata conversion and fixes gcc-2.95 at the same time
Originally committed as revision 17681 to svn://svn.ffmpeg.org/ffmpeg/trunk
-rw-r--r--libavformat/metadata.c20
1 files changed, 9 insertions, 11 deletions
diff --git a/libavformat/metadata.c b/libavformat/metadata.c
index 0ed3cf709a..54c66c9d88 100644
--- a/libavformat/metadata.c
+++ b/libavformat/metadata.c
@@ -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
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;
AVMetadata *dst = NULL;
- const char *key, *key2;
+ const char *key;
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)
- s_conv1 = (const AVMetadataConv[2]){{key,key}};
- for (sc=s_conv1; sc->native; sc++)
+ if (s_conv)
+ for (sc=s_conv; sc->native; sc++)
if (!strcasecmp(key, sc->native)) {
- key2 = sc->generic;
+ key = sc->generic;
break;
}
- if (!d_conv)
- d_conv1 = (const AVMetadataConv[2]){{key2,key2}};
- for (dc=d_conv1; dc->native; dc++)
- if (!strcasecmp(key2, dc->generic)) {
+ if (d_conv)
+ for (dc=d_conv; dc->native; dc++)
+ if (!strcasecmp(key, dc->generic)) {
key = dc->native;
break;
}