aboutsummaryrefslogtreecommitdiffstats
path: root/libavformat
diff options
context:
space:
mode:
authorAurelien Jacobs <aurel@gnuage.org>2009-01-18 22:53:28 +0000
committerAurelien Jacobs <aurel@gnuage.org>2009-01-18 22:53:28 +0000
commit48a81c0ff591347e58b9402534c5cf596ddf0072 (patch)
tree21bbf10e8a8465b1452c340957a9764564ca1445 /libavformat
parentb0973124927d8ea5c8564abfd8f9c087696408e8 (diff)
downloadffmpeg-48a81c0ff591347e58b9402534c5cf596ddf0072.tar.gz
replace AV_METADATA_IGNORE_CASE flag by a new AV_METADATA_MATCH_CASE flag
with the opposed meaning Originally committed as revision 16680 to svn://svn.ffmpeg.org/ffmpeg/trunk
Diffstat (limited to 'libavformat')
-rw-r--r--libavformat/avformat.h2
-rw-r--r--libavformat/avienc.c4
-rw-r--r--libavformat/metadata.c6
-rw-r--r--libavformat/metadata_compat.c3
4 files changed, 7 insertions, 8 deletions
diff --git a/libavformat/avformat.h b/libavformat/avformat.h
index 0df48ab85b..1bd67b6bdf 100644
--- a/libavformat/avformat.h
+++ b/libavformat/avformat.h
@@ -67,7 +67,7 @@ unsigned avformat_version(void);
* A demuxer should set a default if it sets any translated tag.
*/
-#define AV_METADATA_IGNORE_CASE 1
+#define AV_METADATA_MATCH_CASE 1
#define AV_METADATA_IGNORE_SUFFIX 2
typedef struct {
diff --git a/libavformat/avienc.c b/libavformat/avienc.c
index 6267c77b20..7c8a1bbc1e 100644
--- a/libavformat/avienc.c
+++ b/libavformat/avienc.c
@@ -105,9 +105,9 @@ static void avi_write_info_tag(ByteIOContext *pb, const char *tag, const char *s
static void avi_write_info_tag2(AVFormatContext *s, const char *fourcc, const char *key1, const char *key2)
{
- AVMetadataTag *tag= av_metadata_get(s->metadata, key1, NULL, AV_METADATA_IGNORE_CASE);
+ AVMetadataTag *tag= av_metadata_get(s->metadata, key1, NULL, 0);
if(!tag && key2)
- tag= av_metadata_get(s->metadata, key2, NULL, AV_METADATA_IGNORE_CASE);
+ tag= av_metadata_get(s->metadata, key2, NULL, 0);
if(tag)
avi_write_info_tag(s->pb, fourcc, tag->value);
}
diff --git a/libavformat/metadata.c b/libavformat/metadata.c
index 9765e7c62c..eb545fddb4 100644
--- a/libavformat/metadata.c
+++ b/libavformat/metadata.c
@@ -33,8 +33,8 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f
for(; i<m->count; i++){
const char *s= m->elems[i].key;
- if(flags & AV_METADATA_IGNORE_CASE) for(j=0; toupper(s[j]) == toupper(key[j]) && key[j]; j++);
- else for(j=0; s[j] == key[j] && key[j]; j++);
+ if(flags & AV_METADATA_MATCH_CASE) for(j=0; s[j] == key[j] && key[j]; j++);
+ else for(j=0; toupper(s[j]) == toupper(key[j]) && key[j]; j++);
if(key[j])
continue;
if(s[j] && !(flags & AV_METADATA_IGNORE_SUFFIX))
@@ -47,7 +47,7 @@ av_metadata_get(AVMetadata *m, const char *key, const AVMetadataTag *prev, int f
int av_metadata_set(AVMetadata **pm, AVMetadataTag elem)
{
AVMetadata *m= *pm;
- AVMetadataTag *tag= av_metadata_get(m, elem.key, NULL, 0);
+ AVMetadataTag *tag= av_metadata_get(m, elem.key, NULL, AV_METADATA_MATCH_CASE);
if(!m)
m=*pm= av_mallocz(sizeof(*m));
diff --git a/libavformat/metadata_compat.c b/libavformat/metadata_compat.c
index a7f2dfea92..6cde8307e8 100644
--- a/libavformat/metadata_compat.c
+++ b/libavformat/metadata_compat.c
@@ -105,8 +105,7 @@ void ff_metadata_demux_compat(AVFormatContext *ctx)
#define FILL_METADATA(s, key, value) { \
- if (value && *value && \
- !av_metadata_get(s->metadata, #key, NULL, AV_METADATA_IGNORE_CASE)) \
+ if (value && *value && !av_metadata_get(s->metadata, #key, NULL, 0)) \
av_metadata_set(&s->metadata, (const AVMetadataTag){#key, value}); \
}
#define FILL_METADATA_STR(s, key) FILL_METADATA(s, key, s->key)