Clarify comments

Clarify that null-termianted multi-value separators are specific to
ID3v2.4.
parent b125a2b0
...@@ -460,9 +460,9 @@ public final class Id3Decoder extends SimpleMetadataDecoder { ...@@ -460,9 +460,9 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
int descriptionEndIndex = indexOfEos(data, 0, encoding); int descriptionEndIndex = indexOfEos(data, 0, encoding);
String description = new String(data, 0, descriptionEndIndex, charset); String description = new String(data, 0, descriptionEndIndex, charset);
// Text information frames can contain multiple values delimited by a null terminator. // In ID3v2.4, text information frames can contain multiple values delimited by a null
// Thus, we after each "end of stream" marker we actually need to keep looking for more // terminator. Thus, we after each "end of stream" marker we actually need to keep looking
// data, at least until the index is equal to the data length. // for more data, at least until the index is equal to the data length.
ArrayList<String> values = new ArrayList<>(); ArrayList<String> values = new ArrayList<>();
int valueStartIndex = descriptionEndIndex + delimiterLength(encoding); int valueStartIndex = descriptionEndIndex + delimiterLength(encoding);
...@@ -475,7 +475,6 @@ public final class Id3Decoder extends SimpleMetadataDecoder { ...@@ -475,7 +475,6 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
valueEndIndex = indexOfEos(data, valueStartIndex, encoding); valueEndIndex = indexOfEos(data, valueStartIndex, encoding);
} }
return new TextInformationFrame("TXXX", description, values.toArray(new String[0])); return new TextInformationFrame("TXXX", description, values.toArray(new String[0]));
} }
...@@ -493,9 +492,9 @@ public final class Id3Decoder extends SimpleMetadataDecoder { ...@@ -493,9 +492,9 @@ public final class Id3Decoder extends SimpleMetadataDecoder {
byte[] data = new byte[frameSize - 1]; byte[] data = new byte[frameSize - 1];
id3Data.readBytes(data, 0, frameSize - 1); id3Data.readBytes(data, 0, frameSize - 1);
// Text information frames can contain multiple values delimited by a null terminator. // In ID3v2.4, text information frames can contain multiple values delimited by a null
// Thus, we after each "end of stream" marker we actually need to keep looking for more // terminator. Thus, we after each "end of stream" marker we actually need to keep looking
// data, at least until the index is equal to the data length. // for more data, at least until the index is equal to the data length.
ArrayList<String> values = new ArrayList<>(); ArrayList<String> values = new ArrayList<>();
int valueStartIndex = 0; int valueStartIndex = 0;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment