mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +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(
|
private ImmutableList<Metadata> extractMetadataFromTrackSelectionArray(
|
||||||
TrackSelectionArray trackSelectionArray) {
|
TrackSelectionArray trackSelectionArray) {
|
||||||
ImmutableList.Builder<Metadata> builder = new ImmutableList.Builder<>();
|
ImmutableList.Builder<Metadata> result = new ImmutableList.Builder<>();
|
||||||
for (int i = 0; i < trackSelectionArray.length; i++) {
|
for (int i = 0; i < trackSelectionArray.length; i++) {
|
||||||
@Nullable TrackSelection trackSelection = trackSelectionArray.get(i);
|
@Nullable TrackSelection trackSelection = trackSelectionArray.get(i);
|
||||||
if (trackSelection != null) {
|
if (trackSelection != null) {
|
||||||
Format format = trackSelection.getFormat(0);
|
Format format = trackSelection.getFormat(/* index= */ 0);
|
||||||
builder.add(format.metadata == null ? new Metadata() : format.metadata);
|
result.add(format.metadata == null ? new Metadata() : format.metadata);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return builder.build();
|
return result.build();
|
||||||
}
|
}
|
||||||
|
|
||||||
private void enableRenderers() throws ExoPlaybackException {
|
private void enableRenderers() throws ExoPlaybackException {
|
||||||
|
|
|
||||||
|
|
@ -300,8 +300,11 @@ public class EventLogger implements AnalyticsListener {
|
||||||
public void onStaticMetadataChanged(EventTime eventTime, List<Metadata> metadataList) {
|
public void onStaticMetadataChanged(EventTime eventTime, List<Metadata> metadataList) {
|
||||||
logd("staticMetadata [" + getEventTimeString(eventTime));
|
logd("staticMetadata [" + getEventTimeString(eventTime));
|
||||||
for (int i = 0; i < metadataList.size(); i++) {
|
for (int i = 0; i < metadataList.size(); i++) {
|
||||||
logd(" " + i);
|
@Nullable Metadata currentMetadata = metadataList.get(i);
|
||||||
printMetadata(metadataList.get(i), " ");
|
if (currentMetadata != null && currentMetadata.length() != 0) {
|
||||||
|
logd(" " + i);
|
||||||
|
printMetadata(currentMetadata, " ");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
logd("]");
|
logd("]");
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue