mirror of
https://github.com/samsonjs/media.git
synced 2026-04-10 12:05:47 +00:00
Adjust static metadata logging to only list non-empty Metadata.
PiperOrigin-RevId: 336864814
This commit is contained in:
parent
8fdadade7b
commit
9e1c6321ee
2 changed files with 9 additions and 6 deletions
|
|
@ -2121,15 +2121,15 @@ import java.util.concurrent.atomic.AtomicBoolean;
|
|||
|
||||
private ImmutableList<Metadata> extractMetadataFromTrackSelectionArray(
|
||||
TrackSelectionArray trackSelectionArray) {
|
||||
ImmutableList.Builder<Metadata> builder = new ImmutableList.Builder<>();
|
||||
ImmutableList.Builder<Metadata> result = new ImmutableList.Builder<>();
|
||||
for (int i = 0; i < trackSelectionArray.length; i++) {
|
||||
@Nullable TrackSelection trackSelection = trackSelectionArray.get(i);
|
||||
if (trackSelection != null) {
|
||||
Format format = trackSelection.getFormat(0);
|
||||
builder.add(format.metadata == null ? new Metadata() : format.metadata);
|
||||
Format format = trackSelection.getFormat(/* index= */ 0);
|
||||
result.add(format.metadata == null ? new Metadata() : format.metadata);
|
||||
}
|
||||
}
|
||||
return builder.build();
|
||||
return result.build();
|
||||
}
|
||||
|
||||
private void enableRenderers() throws ExoPlaybackException {
|
||||
|
|
|
|||
|
|
@ -300,8 +300,11 @@ public class EventLogger implements AnalyticsListener {
|
|||
public void onStaticMetadataChanged(EventTime eventTime, List<Metadata> metadataList) {
|
||||
logd("staticMetadata [" + getEventTimeString(eventTime));
|
||||
for (int i = 0; i < metadataList.size(); i++) {
|
||||
logd(" " + i);
|
||||
printMetadata(metadataList.get(i), " ");
|
||||
@Nullable Metadata currentMetadata = metadataList.get(i);
|
||||
if (currentMetadata != null && currentMetadata.length() != 0) {
|
||||
logd(" " + i);
|
||||
printMetadata(currentMetadata, " ");
|
||||
}
|
||||
}
|
||||
logd("]");
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue