45 {
"TCOM",
"composer" },
47 {
"TCOP",
"copyright" },
48 {
"TENC",
"encoded_by" },
50 {
"TLAN",
"language" },
52 {
"TPE2",
"album_artist" },
53 {
"TPE3",
"performer" },
55 {
"TPUB",
"publisher" },
57 {
"TSSE",
"encoder" },
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" },
84 "TALB",
"TBPM",
"TCOM",
"TCON",
"TCOP",
"TDLY",
"TENC",
"TEXT",
85 "TFLT",
"TIT1",
"TIT2",
"TIT3",
"TKEY",
"TLAN",
"TLEN",
"TMED",
86 "TOAL",
"TOFN",
"TOLY",
"TOPE",
"TOWN",
"TPE1",
"TPE2",
"TPE3",
87 "TPE4",
"TPOS",
"TPUB",
"TRCK",
"TRSN",
"TRSO",
"TSRC",
"TSSE",
92 "TDEN",
"TDOR",
"TDRC",
"TDRL",
"TDTG",
"TIPL",
"TMCL",
"TMOO",
93 "TPRO",
"TSOA",
"TSOP",
"TSOT",
"TSST",
98 "TDAT",
"TIME",
"TORY",
"TRDA",
"TSIZ",
"TYER",
104 "32x32 pixels 'file icon'",
109 "Media (e.g. label side of CD)",
110 "Lead artist/lead performer/soloist",
115 "Lyricist/text writer",
116 "Recording Location",
118 "During performance",
119 "Movie/video screen capture",
120 "A bright coloured fish",
122 "Band/artist logotype",
123 "Publisher/Studio logotype",
140 return buf[0] == magic[0] &&
141 buf[1] == magic[1] &&
142 buf[2] == magic[2] &&
145 (buf[6] & 0x80) == 0 &&
146 (buf[7] & 0x80) == 0 &&
147 (buf[8] & 0x80) == 0 &&
148 (buf[9] & 0x80) == 0;
153 int len = ((buf[6] & 0x7f) << 21) +
154 ((buf[7] & 0x7f) << 14) +
155 ((buf[8] & 0x7f) << 7) +
167 v = (v << 7) + (
avio_r8(s) & 0x7F);
221 if ((left -= 2) < 0) {
242 while ((left > 1) && ch) {
243 GET_UTF16(ch, ((left -= 2) >= 0 ?
get(pb) : 0),
break;)
286 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
291 if (!(strcmp(key,
"TCON") && strcmp(key,
"TCO")) &&
292 (sscanf(dst,
"(%d)", &genre) == 1 || sscanf(dst,
"%d", &genre) == 1) &&
296 }
else if (!(strcmp(key,
"TXXX") && strcmp(key,
"TXX"))) {
299 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
363 if (!geob_data->
data) {
369 "Error reading GEOB frame, data truncated.\n");
372 geob_data->
data = NULL;
377 new_extra->
tag =
"GEOB";
378 new_extra->
data = geob_data;
379 new_extra->
next = *extra_meta;
380 *extra_meta = new_extra;
393 while (*str >=
'0' && *str <=
'9')
410 char date[17] = { 0 };
429 snprintf(date + 10,
sizeof(date) - 10,
463 if (!new_extra || !apic)
470 taglen -=
avio_get_str(pb, taglen, mimetype,
sizeof(mimetype));
480 "Unknown attached picture mimetype: %s, skipping.\n", mimetype);
498 "Error decoding attached picture description.\n");
507 new_extra->
tag =
"APIC";
508 new_extra->
data = apic;
509 new_extra->
next = *extra_meta;
510 *extra_meta = new_extra;
552 if (taglen < 0 || taglen > len) {
591 while (id3v2_extra_meta_funcs[i].tag3) {
592 if (tag && !memcmp(tag,
593 (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
594 id3v2_extra_meta_funcs[i].tag3),
596 return &id3v2_extra_meta_funcs[i];
610 const char *reason = NULL;
613 unsigned char *
buffer = NULL;
616 unsigned char *uncompressed_buffer = NULL;
617 int uncompressed_buffer_size = 0;
624 reason =
"compression";
642 unsync = flags & 0x80;
644 if (isv34 && flags & 0x40) {
651 reason =
"invalid extended header length";
657 reason =
"extended header too long.";
662 while (len >= taghdrlen) {
663 unsigned int tflags = 0;
685 len -= taghdrlen + tlen;
711 if (tencr || (!CONFIG_ZLIB && tcomp)) {
718 type =
"encrypted and compressed";
723 }
else if (tag[0] ==
'T' ||
728 if (unsync || tunsync || tcomp) {
735 if (unsync || tunsync) {
742 if (*(b - 1) == 0xff &&
avio_tell(s->
pb) < end - 1 &&
761 av_fast_malloc(&uncompressed_buffer, &uncompressed_buffer_size, dlen);
762 if (!uncompressed_buffer) {
767 if (!(unsync || tunsync)) {
776 err = uncompress(uncompressed_buffer, &dlen, buffer, tlen);
791 extra_func->
read(s, pbx, tlen, tag, extra_meta);
792 }
else if (!tag[0]) {
804 if (version == 4 && flags & 0x10)
836 len = ((buf[6] & 0x7f) << 21) |
837 ((buf[7] & 0x7f) << 14) |
838 ((buf[8] & 0x7f) << 7) |
844 }
while (found_header);
859 next = current->
next;
869 for (cur = *extra_meta; cur; cur = cur->
next) {
873 if (strcmp(cur->
tag,
"APIC"))