From 0cdece3a3f9beb237e7558ab8c48ca4d74c75d40 Mon Sep 17 00:00:00 2001 From: Alexander Capehart Date: Wed, 7 Sep 2022 20:57:53 -0600 Subject: [PATCH] Clarify comments Clarify that null-termianted multi-value separators are specific to ID3v2.4. --- .../exoplayer2/metadata/id3/Id3Decoder.java | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) diff --git a/library/extractor/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java b/library/extractor/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java index 473cf12ae7..bf0ab5a5ca 100644 --- a/library/extractor/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java +++ b/library/extractor/src/main/java/com/google/android/exoplayer2/metadata/id3/Id3Decoder.java @@ -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 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 values = new ArrayList<>(); int valueStartIndex = 0;