Clarify comments

Clarify that null-termianted multi-value separators are specific to
ID3v2.4.
This commit is contained in:
Alexander Capehart 2022-09-07 20:57:53 -06:00
parent b125a2b0b3
commit 0cdece3a3f
No known key found for this signature in database
GPG Key ID: 37DBE3621FE9AD47

View File

@ -459,10 +459,10 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
int descriptionEndIndex = indexOfEos(data, 0, encoding);
String description = new String(data, 0, descriptionEndIndex, charset);
// Text information frames can contain multiple values delimited by a null terminator.
// Thus, we after each "end of stream" marker we actually need to keep looking for more
// data, at least until the index is equal to the data length.
// In ID3v2.4, text information frames can contain multiple values delimited by a null
// terminator. Thus, we after each "end of stream" marker we actually need to keep looking
// for more data, at least until the index is equal to the data length.
ArrayList<String> values = new ArrayList<>();
int valueStartIndex = descriptionEndIndex + delimiterLength(encoding);
@ -475,7 +475,6 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
valueEndIndex = indexOfEos(data, valueStartIndex, encoding);
}
return new TextInformationFrame("TXXX", description, values.toArray(new String[0]));
}
@ -493,9 +492,9 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
byte[] data = new byte[frameSize - 1];
id3Data.readBytes(data, 0, frameSize - 1);
// Text information frames can contain multiple values delimited by a null terminator.
// Thus, we after each "end of stream" marker we actually need to keep looking for more
// data, at least until the index is equal to the data length.
// In ID3v2.4, text information frames can contain multiple values delimited by a null
// terminator. Thus, we after each "end of stream" marker we actually need to keep looking
// for more data, at least until the index is equal to the data length.
ArrayList<String> values = new ArrayList<>();
int valueStartIndex = 0;