Fix FlacStreamMetadata compile failure

Comment concatenation was accidentally not added previously, which
results in a testing failure.
This commit is contained in:
OxygenCobalt 2022-01-17 10:34:49 -07:00
parent fc08f866ce
commit a4682cbff5
No known key found for this signature in database
GPG Key ID: 37DBE3621FE9AD47

View File

@ -143,8 +143,7 @@ public final class FlacStreamMetadata {
bitsPerSample, bitsPerSample,
totalSamples, totalSamples,
/* seekTable= */ null, /* seekTable= */ null,
new Metadata(pictureFrames) concatenateVorbisMetadata(vorbisComments, pictureFrames));
.copyWithAppendedEntriesFrom(VorbisUtil.parseVorbisComments(vorbisComments)));
} }
private FlacStreamMetadata( private FlacStreamMetadata(
@ -250,6 +249,22 @@ public final class FlacStreamMetadata {
return metadata == null ? other : metadata.copyWithAppendedEntriesFrom(other); return metadata == null ? other : metadata.copyWithAppendedEntriesFrom(other);
} }
/** Returns */
@Nullable
private static Metadata concatenateVorbisMetadata(
List<String> vorbisComments,
List<PictureFrame> pictureFrames
) {
@Nullable Metadata parsedVorbisComments = VorbisUtil.parseVorbisComments(vorbisComments);
if (parsedVorbisComments == null && pictureFrames.isEmpty()) {
return null;
}
return new Metadata(pictureFrames)
.copyWithAppendedEntriesFrom(parsedVorbisComments);
}
/** Returns a copy of {@code this} with the seek table replaced by the one given. */ /** Returns a copy of {@code this} with the seek table replaced by the one given. */
public FlacStreamMetadata copyWithSeekTable(@Nullable SeekTable seekTable) { public FlacStreamMetadata copyWithSeekTable(@Nullable SeekTable seekTable) {
return new FlacStreamMetadata( return new FlacStreamMetadata(