45 {
"TCOM",
"composer"},
47 {
"TCOP",
"copyright"},
48 {
"TENC",
"encoded_by"},
50 {
"TLAN",
"language"},
52 {
"TPE2",
"album_artist"},
53 {
"TPE3",
"performer"},
55 {
"TPUB",
"publisher"},
64 {
"TDEN",
"creation_time"},
65 {
"TSOA",
"album-sort"},
66 {
"TSOP",
"artist-sort"},
67 {
"TSOT",
"title-sort"},
75 {
"TEN",
"encoded_by"},
77 {
"TP2",
"album_artist"},
78 {
"TP3",
"performer"},
85 "TALB",
"TBPM",
"TCOM",
"TCON",
"TCOP",
"TDLY",
"TENC",
"TEXT",
86 "TFLT",
"TIT1",
"TIT2",
"TIT3",
"TKEY",
"TLAN",
"TLEN",
"TMED",
87 "TOAL",
"TOFN",
"TOLY",
"TOPE",
"TOWN",
"TPE1",
"TPE2",
"TPE3",
88 "TPE4",
"TPOS",
"TPUB",
"TRCK",
"TRSN",
"TRSO",
"TSRC",
"TSSE",
93 "TDEN",
"TDOR",
"TDRC",
"TDRL",
"TDTG",
"TIPL",
"TMCL",
"TMOO",
94 "TPRO",
"TSOA",
"TSOP",
"TSOT",
"TSST",
99 "TDAT",
"TIME",
"TORY",
"TRDA",
"TSIZ",
"TYER",
105 "32x32 pixels 'file icon'",
110 "Media (e.g. label side of CD)",
111 "Lead artist/lead performer/soloist",
116 "Lyricist/text writer",
117 "Recording Location",
119 "During performance",
120 "Movie/video screen capture",
121 "A bright coloured fish",
123 "Band/artist logotype",
124 "Publisher/Studio logotype",
141 return buf[0] == magic[0] &&
142 buf[1] == magic[1] &&
143 buf[2] == magic[2] &&
146 (buf[6] & 0x80) == 0 &&
147 (buf[7] & 0x80) == 0 &&
148 (buf[8] & 0x80) == 0 &&
149 (buf[9] & 0x80) == 0;
154 int len = ((buf[6] & 0x7f) << 21) +
155 ((buf[7] & 0x7f) << 14) +
156 ((buf[8] & 0x7f) << 7) +
168 v = (v << 7) + (
avio_r8(s) & 0x7F);
223 if ((left -= 2) < 0) {
244 while ((left > 1) && ch) {
245 GET_UTF16(ch, ((left -= 2) >= 0 ?
get(pb) : 0),
break;)
287 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
292 if (!(strcmp(key,
"TCON") && strcmp(key,
"TCO"))
293 && (sscanf(dst,
"(%d)", &genre) == 1 || sscanf(dst,
"%d", &genre) == 1)
297 }
else if (!(strcmp(key,
"TXXX") && strcmp(key,
"TXX"))) {
300 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
360 if (!geob_data->
data) {
373 new_extra->
tag =
"GEOB";
374 new_extra->
data = geob_data;
375 new_extra->
next = *extra_meta;
376 *extra_meta = new_extra;
389 while (*str >=
'0' && *str <=
'9') str++;
456 if (!new_extra || !apic)
463 taglen -=
avio_get_str(pb, taglen, mimetype,
sizeof(mimetype));
498 new_extra->
tag =
"APIC";
499 new_extra->
data = apic;
500 new_extra->
next = *extra_meta;
501 *extra_meta = new_extra;
518 taglen -=
avio_get_str(pb, taglen, title,
sizeof(title));
530 if (!memcmp(tag,
"TIT2", 4)) {
564 while (id3v2_extra_meta_funcs[i].tag3) {
565 if (tag && !memcmp(tag,
566 (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
567 id3v2_extra_meta_funcs[i].tag3),
569 return &id3v2_extra_meta_funcs[i];
582 const char *reason =
NULL;
588 unsigned char *uncompressed_buffer =
NULL;
589 int uncompressed_buffer_size = 0;
596 reason =
"compression";
614 unsync = flags & 0x80;
616 if (isv34 && flags & 0x40) {
622 reason =
"invalid extended header length";
628 reason =
"extended header too long.";
633 while (len >= taghdrlen) {
634 unsigned int tflags = 0;
656 len -= taghdrlen + tlen;
681 if (tencr || (!CONFIG_ZLIB && tcomp)) {
688 type =
"encrypted and compressed";
693 }
else if (tag[0] ==
'T' || (extra_meta && (extra_func =
get_extra_meta_func(tag, isv34)))) {
696 if (unsync || tunsync || tcomp) {
703 if (unsync || tunsync) {
710 if (*(b - 1) == 0xff &&
avio_tell(s->
pb) < end - 1 &&
728 av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
729 if (!uncompressed_buffer) {
734 if (!(unsync || tunsync)) {
743 err = uncompress(uncompressed_buffer, &dlen, buffer, tlen);
758 extra_func->
read(s, pbx, tlen, tag, extra_meta);
771 if (version == 4 && flags & 0x10)
776 av_log(s,
AV_LOG_INFO,
"ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
799 len = ((buf[6] & 0x7f) << 21) |
800 ((buf[7] & 0x7f) << 14) |
801 ((buf[8] & 0x7f) << 7) |
807 }
while (found_header);
822 next = current->
next;
832 for (cur = *extra_meta; cur; cur = cur->
next) {
836 if (strcmp(cur->
tag,
"APIC"))