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));
497 new_extra->
tag =
"APIC";
498 new_extra->
data = apic;
499 new_extra->
next = *extra_meta;
500 *extra_meta = new_extra;
517 taglen -=
avio_get_str(pb, taglen, title,
sizeof(title));
529 if (!memcmp(tag,
"TIT2", 4)) {
563 while (id3v2_extra_meta_funcs[i].tag3) {
564 if (tag && !memcmp(tag,
565 (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
566 id3v2_extra_meta_funcs[i].tag3),
568 return &id3v2_extra_meta_funcs[i];
581 const char *reason =
NULL;
587 unsigned char *uncompressed_buffer =
NULL;
588 int uncompressed_buffer_size = 0;
595 reason =
"compression";
613 unsync = flags & 0x80;
615 if (isv34 && flags & 0x40) {
621 reason =
"invalid extended header length";
627 reason =
"extended header too long.";
632 while (len >= taghdrlen) {
633 unsigned int tflags = 0;
655 len -= taghdrlen + tlen;
680 if (tencr || (!CONFIG_ZLIB && tcomp)) {
687 type =
"encrypted and compressed";
692 }
else if (tag[0] ==
'T' || (extra_meta && (extra_func =
get_extra_meta_func(tag, isv34)))) {
695 if (unsync || tunsync || tcomp) {
702 if (unsync || tunsync) {
707 while (
avio_tell(s->
pb) < end && b - buffer < tlen) {
709 if (*(b - 1) == 0xff &&
avio_tell(s->
pb) < end - 1 && b - buffer < tlen) {
725 av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
726 if (!uncompressed_buffer) {
731 if (!(unsync || tunsync)) {
740 err = uncompress(uncompressed_buffer, &dlen, buffer, tlen);
755 extra_func->
read(s, pbx, tlen, tag, extra_meta);
768 if (version == 4 && flags & 0x10)
773 av_log(s,
AV_LOG_INFO,
"ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
798 len = ((buf[6] & 0x7f) << 21) |
799 ((buf[7] & 0x7f) << 14) |
800 ((buf[8] & 0x7f) << 7) |
806 }
while (found_header);
821 next = current->
next;
831 for (cur = *extra_meta; cur; cur = cur->
next) {
835 if (strcmp(cur->
tag,
"APIC"))