diff options
author | Michael Niedermayer <michaelni@gmx.at> | 2011-06-09 06:47:19 +0400 |
---|---|---|
committer | Michael Niedermayer <michaelni@gmx.at> | 2011-06-09 06:47:19 +0400 |
commit | f9ecb849ef39bc337d9439b829fe08da5c95cc3d (patch) | |
tree | 761e860a10084d8de4f07815911f697fe11610b9 /libavformat/id3v2.c | |
parent | 7b8ed831eb8432d202dad16dedc1758b018bb1fa (diff) | |
parent | a71bcd1a7f66e210971c44452dc4cdae7bdbd98a (diff) |
Merge remote-tracking branch 'qatar/master'
* qatar/master:
crypto: Use av_freep instead of av_free
lavf: don't try to free private options if priv_data is NULL.
swscale: fix types of assembly arguments.
swscale: move two macros that are only used once into caller.
swscale: remove unused function.
options: Add missing braces around struct initializer.
mov: Remove leftover crufty debug statement with references to a local file.
dvbsubdec: Fix compilation of debug code.
Remove all uses of now deprecated metadata functions.
Move metadata API from lavf to lavu.
Conflicts:
doc/APIchanges
libavformat/aiffdec.c
libavformat/asfdec.c
libavformat/avformat.h
libavformat/avidec.c
libavformat/cafdec.c
libavformat/matroskaenc.c
libavformat/mov.c
libavformat/mp3enc.c
libavformat/wtv.c
libavutil/avutil.h
libavutil/internal.h
libswscale/swscale.c
libswscale/x86/swscale_template.c
Merged-by: Michael Niedermayer <michaelni@gmx.at>
Diffstat (limited to 'libavformat/id3v2.c')
-rw-r--r-- | libavformat/id3v2.c | 28 |
1 files changed, 14 insertions, 14 deletions
diff --git a/libavformat/id3v2.c b/libavformat/id3v2.c index 4e0c7d47ce..930ab5c870 100644 --- a/libavformat/id3v2.c +++ b/libavformat/id3v2.c @@ -30,7 +30,7 @@ #include "id3v1.h" #include "libavutil/avstring.h" #include "libavutil/intreadwrite.h" -#include "metadata.h" +#include "libavutil/dict.h" #include "avio_internal.h" int ff_id3v2_match(const uint8_t *buf, const char * magic) @@ -140,7 +140,7 @@ static void read_ttag(AVFormatContext *s, AVIOContext *pb, int taglen, const cha val = dst; if (val) - av_metadata_set2(&s->metadata, key, val, AV_METADATA_DONT_OVERWRITE); + av_dict_set(&s->metadata, key, val, AV_DICT_DONT_OVERWRITE); } static int is_number(const char *str) @@ -149,44 +149,44 @@ static int is_number(const char *str) return !*str; } -static AVMetadataTag* get_date_tag(AVMetadata *m, const char *tag) +static AVDictionaryEntry* get_date_tag(AVDictionary *m, const char *tag) { - AVMetadataTag *t; - if ((t = av_metadata_get(m, tag, NULL, AV_METADATA_MATCH_CASE)) && + AVDictionaryEntry *t; + if ((t = av_dict_get(m, tag, NULL, AV_DICT_MATCH_CASE)) && strlen(t->value) == 4 && is_number(t->value)) return t; return NULL; } -static void merge_date(AVMetadata **m) +static void merge_date(AVDictionary **m) { - AVMetadataTag *t; + AVDictionaryEntry *t; char date[17] = {0}; // YYYY-MM-DD hh:mm if (!(t = get_date_tag(*m, "TYER")) && !(t = get_date_tag(*m, "TYE"))) return; av_strlcpy(date, t->value, 5); - av_metadata_set2(m, "TYER", NULL, 0); - av_metadata_set2(m, "TYE", NULL, 0); + av_dict_set(m, "TYER", NULL, 0); + av_dict_set(m, "TYE", NULL, 0); if (!(t = get_date_tag(*m, "TDAT")) && !(t = get_date_tag(*m, "TDA"))) goto finish; snprintf(date + 4, sizeof(date) - 4, "-%.2s-%.2s", t->value + 2, t->value); - av_metadata_set2(m, "TDAT", NULL, 0); - av_metadata_set2(m, "TDA", NULL, 0); + av_dict_set(m, "TDAT", NULL, 0); + av_dict_set(m, "TDA", NULL, 0); if (!(t = get_date_tag(*m, "TIME")) && !(t = get_date_tag(*m, "TIM"))) goto finish; snprintf(date + 10, sizeof(date) - 10, " %.2s:%.2s", t->value, t->value + 2); - av_metadata_set2(m, "TIME", NULL, 0); - av_metadata_set2(m, "TIM", NULL, 0); + av_dict_set(m, "TIME", NULL, 0); + av_dict_set(m, "TIM", NULL, 0); finish: if (date[0]) - av_metadata_set2(m, "date", date, 0); + av_dict_set(m, "date", date, 0); } static void ff_id3v2_parse(AVFormatContext *s, int len, uint8_t version, uint8_t flags) |