metadata: make conversion to the same format a noop.

Patch by Anton Khirnov, wyskas at gmail

Originally committed as revision 23466 to svn://svn.ffmpeg.org/ffmpeg/trunk
This commit is contained in:
Anton Khirnov 2010-06-04 07:32:09 +00:00 committed by Martin Storsjö
parent 35d8ecc54e
commit 795c6a6b1f

View File

@ -117,9 +117,11 @@ void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
AVMetadata *dst = NULL; AVMetadata *dst = NULL;
const char *key; const char *key;
if (d_conv == s_conv)
return;
while((mtag=av_metadata_get(*pm, "", mtag, AV_METADATA_IGNORE_SUFFIX))) { while((mtag=av_metadata_get(*pm, "", mtag, AV_METADATA_IGNORE_SUFFIX))) {
key = mtag->key; key = mtag->key;
if (s_conv != d_conv) {
if (s_conv) if (s_conv)
for (sc=s_conv; sc->native; sc++) for (sc=s_conv; sc->native; sc++)
if (!strcasecmp(key, sc->native)) { if (!strcasecmp(key, sc->native)) {
@ -132,7 +134,6 @@ void metadata_conv(AVMetadata **pm, const AVMetadataConv *d_conv,
key = dc->native; key = dc->native;
break; break;
} }
}
av_metadata_set2(&dst, key, mtag->value, 0); av_metadata_set2(&dst, key, mtag->value, 0);
} }
av_metadata_free(pm); av_metadata_free(pm);