mirror of
https://github.com/cookiengineer/audacity
synced 2025-07-01 15:43:44 +02:00
When libid3tag encounters the "TYER" tag, it converts it to a
"ZOBS" (obsolete) tag and adds a "TDRC" tag at the end of the list of tags using the first 4 characters of the "TYER" tag. Since we write both the "TDRC" and "TYER" tags, the "TDRC" tag will always be encountered first in the list. We want use it since the converted "TYER" tag may have been truncated.
This commit is contained in:
parent
60af76d2b3
commit
8d4fb73452
@ -304,6 +304,7 @@ void MP3ImportFileHandle::ImportID3(Tags *tags)
|
||||
tags->Clear();
|
||||
|
||||
// Loop through all frames
|
||||
bool have_year = false;
|
||||
for (int i = 0; i < (int) tp->nframes; i++) {
|
||||
struct id3_frame *frame = tp->frames[i];
|
||||
|
||||
@ -333,11 +334,18 @@ void MP3ImportFileHandle::ImportID3(Tags *tags)
|
||||
else if (strcmp(frame->id, ID3_FRAME_TRACK) == 0) {
|
||||
n = TAG_TRACK;
|
||||
}
|
||||
else if (strcmp(frame->id, "TYER") == 0) {
|
||||
n = TAG_YEAR;
|
||||
}
|
||||
else if (strcmp(frame->id, ID3_FRAME_YEAR) == 0) {
|
||||
// LLL: When libid3tag encounters the "TYER" tag, it converts it to a
|
||||
// "ZOBS" (obsolete) tag and adds a "TDRC" tag at the end of the
|
||||
// list of tags using the first 4 characters of the "TYER" tag.
|
||||
// Since we write both the "TDRC" and "TYER" tags, the "TDRC" tag
|
||||
// will always be encountered first in the list. We want use it
|
||||
// since the converted "TYER" tag may have been truncated.
|
||||
if (have_year) {
|
||||
continue;
|
||||
}
|
||||
n = TAG_YEAR;
|
||||
have_year = true;
|
||||
}
|
||||
else if (strcmp(frame->id, ID3_FRAME_COMMENT) == 0) {
|
||||
n = TAG_COMMENTS;
|
||||
|
@ -415,6 +415,7 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
|
||||
}
|
||||
|
||||
// Loop through all frames
|
||||
bool have_year = false;
|
||||
for (int i = 0; i < (int) tp->nframes; i++) {
|
||||
struct id3_frame *frame = tp->frames[i];
|
||||
|
||||
@ -444,11 +445,18 @@ int PCMImportFileHandle::Import(TrackFactory *trackFactory,
|
||||
else if (strcmp(frame->id, ID3_FRAME_TRACK) == 0) {
|
||||
n = TAG_TRACK;
|
||||
}
|
||||
else if (strcmp(frame->id, "TYER") == 0) {
|
||||
n = TAG_YEAR;
|
||||
}
|
||||
else if (strcmp(frame->id, ID3_FRAME_YEAR) == 0) {
|
||||
// LLL: When libid3tag encounters the "TYER" tag, it converts it to a
|
||||
// "ZOBS" (obsolete) tag and adds a "TDRC" tag at the end of the
|
||||
// list of tags using the first 4 characters of the "TYER" tag.
|
||||
// Since we write both the "TDRC" and "TYER" tags, the "TDRC" tag
|
||||
// will always be encountered first in the list. We want use it
|
||||
// since the converted "TYER" tag may have been truncated.
|
||||
if (have_year) {
|
||||
continue;
|
||||
}
|
||||
n = TAG_YEAR;
|
||||
have_year = true;
|
||||
}
|
||||
else if (strcmp(frame->id, ID3_FRAME_COMMENT) == 0) {
|
||||
n = TAG_COMMENTS;
|
||||
|
Loading…
x
Reference in New Issue
Block a user