31 {
"TCOM",
"composer"},
33 {
"TCOP",
"copyright"},
34 {
"TENC",
"encoded_by"},
36 {
"TLAN",
"language"},
38 {
"TPE2",
"album_artist"},
39 {
"TPE3",
"performer"},
41 {
"TPUB",
"publisher"},
50 {
"TDEN",
"creation_time"},
51 {
"TSOA",
"album-sort"},
52 {
"TSOP",
"artist-sort"},
53 {
"TSOT",
"title-sort"},
61 {
"TEN",
"encoded_by"},
63 {
"TP2",
"album_artist"},
64 {
"TP3",
"performer"},
71 "TALB",
"TBPM",
"TCOM",
"TCON",
"TCOP",
"TDLY",
"TENC",
"TEXT",
72 "TFLT",
"TIT1",
"TIT2",
"TIT3",
"TKEY",
"TLAN",
"TLEN",
"TMED",
73 "TOAL",
"TOFN",
"TOLY",
"TOPE",
"TOWN",
"TPE1",
"TPE2",
"TPE3",
74 "TPE4",
"TPOS",
"TPUB",
"TRCK",
"TRSN",
"TRSO",
"TSRC",
"TSSE",
79 "TDEN",
"TDOR",
"TDRC",
"TDRL",
"TDTG",
"TIPL",
"TMCL",
"TMOO",
80 "TPRO",
"TSOA",
"TSOP",
"TSOT",
"TSST",
85 "TDAT",
"TIME",
"TORY",
"TRDA",
"TSIZ",
"TYER",
91 return buf[0] == magic[0] &&
96 (buf[6] & 0x80) == 0 &&
97 (buf[7] & 0x80) == 0 &&
98 (buf[8] & 0x80) == 0 &&
104 int len = ((buf[6] & 0x7f) << 21) +
105 ((buf[7] & 0x7f) << 14) +
106 ((buf[8] & 0x7f) << 7) +
118 v = (v << 7) + (
avio_r8(s) & 0x7F);
148 uint8_t **dst,
int *maxread)
173 if ((left -= 2) < 0) {
194 while ((left > 1) && ch) {
195 GET_UTF16(ch, ((left -= 2) >= 0 ?
get(pb) : 0),
break;)
237 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
242 if (!(strcmp(key,
"TCON") && strcmp(key,
"TCO"))
243 && (sscanf(dst,
"(%d)", &genre) == 1 || sscanf(dst,
"%d", &genre) == 1)
247 }
else if (!(strcmp(key,
"TXXX") && strcmp(key,
"TXX"))) {
250 if (
decode_str(s, pb, encoding, &dst, &taglen) < 0) {
311 if (!geob_data->
data) {
324 new_extra->
tag =
"GEOB";
325 new_extra->
data = geob_data;
326 new_extra->
next = *extra_meta;
327 *extra_meta = new_extra;
340 while (*str >=
'0' && *str <=
'9') str++;
368 snprintf(date + 4,
sizeof(date) - 4,
"-%.2s-%.2s", t->
value + 2, t->
value);
375 snprintf(date + 10,
sizeof(date) - 10,
" %.2s:%.2s", t->
value, t->
value + 2);
404 while (id3v2_extra_meta_funcs[i].tag3) {
406 (isv34 ? id3v2_extra_meta_funcs[i].tag4 :
407 id3v2_extra_meta_funcs[i].tag3),
409 return &id3v2_extra_meta_funcs[i];
417 int isv34, tlen, unsync;
421 const char *reason =
NULL;
431 reason =
"compression";
449 unsync = flags & 0x80;
451 if (isv34 && flags & 0x40) {
457 reason =
"invalid extended header length";
463 while (len >= taghdrlen) {
464 unsigned int tflags = 0;
481 if (tlen < 0 || tlen > len - taghdrlen) {
485 len -= taghdrlen + tlen;
503 }
else if (tag[0] ==
'T' || (extra_meta && (extra_func =
get_extra_meta_func(tag, isv34)))) {
504 if (unsync || tunsync) {
515 if (*(b - 1) == 0xff &&
avio_tell(s->
pb) < end - 1 &&
532 extra_func->
read(s, pbx, tlen, tag, extra_meta);
545 if (version == 4 && flags & 0x10)
550 av_log(s,
AV_LOG_INFO,
"ID3v2.%d tag skipped, cannot handle %s\n", version, reason);
572 len = ((buf[6] & 0x7f) << 21) |
573 ((buf[7] & 0x7f) << 14) |
574 ((buf[8] & 0x7f) << 7) |
580 }
while (found_header);
600 next = current->
next;