diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java index 7d5e3e35c1..05fbfc417c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImpl.java @@ -138,8 +138,15 @@ import java.util.List; Clock clock, Looper applicationLooper, @Nullable Player wrappingPlayer) { - Log.i(TAG, "Init " + Integer.toHexString(System.identityHashCode(this)) + " [" - + ExoPlayerLibraryInfo.VERSION_SLASHY + "] [" + Util.DEVICE_DEBUG_INFO + "]"); + Log.i( + TAG, + "Init " + + Integer.toHexString(System.identityHashCode(this)) + + " [" + + ExoPlayerLibraryInfo.VERSION_SLASHY + + "] [" + + Util.DEVICE_DEBUG_INFO + + "]"); checkState(renderers.length > 0); this.renderers = checkNotNull(renderers); this.trackSelector = checkNotNull(trackSelector); @@ -731,9 +738,17 @@ import java.util.List; @Override public void release() { - Log.i(TAG, "Release " + Integer.toHexString(System.identityHashCode(this)) + " [" - + ExoPlayerLibraryInfo.VERSION_SLASHY + "] [" + Util.DEVICE_DEBUG_INFO + "] [" - + ExoPlayerLibraryInfo.registeredModules() + "]"); + Log.i( + TAG, + "Release " + + Integer.toHexString(System.identityHashCode(this)) + + " [" + + ExoPlayerLibraryInfo.VERSION_SLASHY + + "] [" + + Util.DEVICE_DEBUG_INFO + + "] [" + + ExoPlayerLibraryInfo.registeredModules() + + "]"); if (!internalPlayer.release()) { // One of the renderers timed out releasing its resources. listeners.sendEvent( @@ -890,7 +905,7 @@ import java.util.List; @Override public TrackSelectionArray getCurrentTrackSelections() { - return playbackInfo.trackSelectorResult.selections; + return new TrackSelectionArray(playbackInfo.trackSelectorResult.selections); } @Override @@ -1013,11 +1028,11 @@ import java.util.List; } if (previousPlaybackInfo.trackSelectorResult != newPlaybackInfo.trackSelectorResult) { trackSelector.onSelectionActivated(newPlaybackInfo.trackSelectorResult.info); + TrackSelectionArray newSelection = + new TrackSelectionArray(newPlaybackInfo.trackSelectorResult.selections); listeners.queueEvent( Player.EVENT_TRACKS_CHANGED, - listener -> - listener.onTracksChanged( - newPlaybackInfo.trackGroups, newPlaybackInfo.trackSelectorResult.selections)); + listener -> listener.onTracksChanged(newPlaybackInfo.trackGroups, newSelection)); } if (!previousPlaybackInfo.staticMetadata.equals(newPlaybackInfo.staticMetadata)) { listeners.queueEvent( diff --git a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java index 046149d135..d025b73ac1 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/ExoPlayerImplInternal.java @@ -726,8 +726,7 @@ import java.util.concurrent.atomic.AtomicBoolean; private void notifyTrackSelectionPlayWhenReadyChanged(boolean playWhenReady) { MediaPeriodHolder periodHolder = queue.getPlayingPeriod(); while (periodHolder != null) { - TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); - for (TrackSelection trackSelection : trackSelections) { + for (TrackSelection trackSelection : periodHolder.getTrackSelectorResult().selections) { if (trackSelection != null) { trackSelection.onPlayWhenReadyChanged(playWhenReady); } @@ -901,8 +900,7 @@ import java.util.concurrent.atomic.AtomicBoolean; private void notifyTrackSelectionRebuffer() { MediaPeriodHolder periodHolder = queue.getPlayingPeriod(); while (periodHolder != null) { - TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); - for (TrackSelection trackSelection : trackSelections) { + for (TrackSelection trackSelection : periodHolder.getTrackSelectorResult().selections) { if (trackSelection != null) { trackSelection.onRebuffer(); } @@ -1692,8 +1690,7 @@ import java.util.concurrent.atomic.AtomicBoolean; private void updateTrackSelectionPlaybackSpeed(float playbackSpeed) { MediaPeriodHolder periodHolder = queue.getPlayingPeriod(); while (periodHolder != null) { - TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); - for (TrackSelection trackSelection : trackSelections) { + for (TrackSelection trackSelection : periodHolder.getTrackSelectorResult().selections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } @@ -1705,8 +1702,7 @@ import java.util.concurrent.atomic.AtomicBoolean; private void notifyTrackSelectionDiscontinuity() { MediaPeriodHolder periodHolder = queue.getPlayingPeriod(); while (periodHolder != null) { - TrackSelection[] trackSelections = periodHolder.getTrackSelectorResult().selections.getAll(); - for (TrackSelection trackSelection : trackSelections) { + for (TrackSelection trackSelection : periodHolder.getTrackSelectorResult().selections) { if (trackSelection != null) { trackSelection.onDiscontinuity(); } @@ -2018,7 +2014,7 @@ import java.util.concurrent.atomic.AtomicBoolean; } if (!renderer.isCurrentStreamFinal()) { // The renderer stream is not final, so we can replace the sample streams immediately. - Format[] formats = getFormats(newTrackSelectorResult.selections.get(i)); + Format[] formats = getFormats(newTrackSelectorResult.selections[i]); renderer.replaceStream( formats, readingPeriodHolder.sampleStreams[i], @@ -2268,11 +2264,10 @@ import java.util.concurrent.atomic.AtomicBoolean; } private ImmutableList extractMetadataFromTrackSelectionArray( - TrackSelectionArray trackSelectionArray) { + TrackSelection[] trackSelections) { ImmutableList.Builder result = new ImmutableList.Builder<>(); boolean seenNonEmptyMetadata = false; - for (int i = 0; i < trackSelectionArray.length; i++) { - @Nullable TrackSelection trackSelection = trackSelectionArray.get(i); + for (TrackSelection trackSelection : trackSelections) { if (trackSelection != null) { Format format = trackSelection.getFormat(/* index= */ 0); if (format.metadata == null) { @@ -2320,7 +2315,7 @@ import java.util.concurrent.atomic.AtomicBoolean; TrackSelectorResult trackSelectorResult = periodHolder.getTrackSelectorResult(); RendererConfiguration rendererConfiguration = trackSelectorResult.rendererConfigurations[rendererIndex]; - TrackSelection newSelection = trackSelectorResult.selections.get(rendererIndex); + TrackSelection newSelection = trackSelectorResult.selections[rendererIndex]; Format[] formats = getFormats(newSelection); // The renderer needs enabling with its new track selection. boolean playing = shouldPlayWhenReady() && playbackInfo.playbackState == Player.STATE_READY; @@ -2401,7 +2396,8 @@ import java.util.concurrent.atomic.AtomicBoolean; private void updateLoadControlTrackSelection( TrackGroupArray trackGroups, TrackSelectorResult trackSelectorResult) { - loadControl.onTracksSelected(renderers, trackGroups, trackSelectorResult.selections); + TrackSelectionArray newSelection = new TrackSelectionArray(trackSelectorResult.selections); + loadControl.onTracksSelected(renderers, trackGroups, newSelection); } private boolean shouldPlayWhenReady() { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodHolder.java b/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodHolder.java index 6bbd609dd5..4bf0c98888 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodHolder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/MediaPeriodHolder.java @@ -25,7 +25,6 @@ import com.google.android.exoplayer2.source.MediaSource.MediaPeriodId; import com.google.android.exoplayer2.source.SampleStream; import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.trackselection.TrackSelection; -import com.google.android.exoplayer2.trackselection.TrackSelectionArray; import com.google.android.exoplayer2.trackselection.TrackSelector; import com.google.android.exoplayer2.trackselection.TrackSelectorResult; import com.google.android.exoplayer2.upstream.Allocator; @@ -233,7 +232,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, getTrackGroups(), info.id, timeline); - for (TrackSelection trackSelection : selectorResult.selections.getAll()) { + for (TrackSelection trackSelection : selectorResult.selections) { if (trackSelection != null) { trackSelection.onPlaybackSpeed(playbackSpeed); } @@ -289,10 +288,9 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; trackSelectorResult = newTrackSelectorResult; enableTrackSelectionsInResult(); // Disable streams on the period and get new streams for updated/newly-enabled tracks. - TrackSelectionArray trackSelections = newTrackSelectorResult.selections; positionUs = mediaPeriod.selectTracks( - trackSelections.getAll(), + newTrackSelectorResult.selections, mayRetainStreamFlags, sampleStreams, streamResetFlags, @@ -309,7 +307,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; hasEnabledTracks = true; } } else { - Assertions.checkState(trackSelections.get(i) == null); + Assertions.checkState(newTrackSelectorResult.selections[i] == null); } } return positionUs; @@ -361,7 +359,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; } for (int i = 0; i < trackSelectorResult.length; i++) { boolean rendererEnabled = trackSelectorResult.isRendererEnabled(i); - TrackSelection trackSelection = trackSelectorResult.selections.get(i); + TrackSelection trackSelection = trackSelectorResult.selections[i]; if (rendererEnabled && trackSelection != null) { trackSelection.enable(); } @@ -374,7 +372,7 @@ import org.checkerframework.checker.nullness.compatqual.NullableType; } for (int i = 0; i < trackSelectorResult.length; i++) { boolean rendererEnabled = trackSelectorResult.isRendererEnabled(i); - TrackSelection trackSelection = trackSelectorResult.selections.get(i); + TrackSelection trackSelection = trackSelectorResult.selections[i]; if (rendererEnabled && trackSelection != null) { trackSelection.disable(); } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java index 60df8413b1..21bb1aa20b 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/offline/DownloadHelper.java @@ -847,7 +847,7 @@ public final class DownloadHelper { new MediaPeriodId(mediaPreparer.timeline.getUidOfPeriod(periodIndex)), mediaPreparer.timeline); for (int i = 0; i < trackSelectorResult.length; i++) { - @Nullable TrackSelection newSelection = trackSelectorResult.selections.get(i); + @Nullable TrackSelection newSelection = trackSelectorResult.selections[i]; if (newSelection == null) { continue; } diff --git a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java index 67623c2cf6..b5bff9ce76 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/TrackSelectorResult.java @@ -20,9 +20,7 @@ import com.google.android.exoplayer2.RendererConfiguration; import com.google.android.exoplayer2.util.Util; import org.checkerframework.checker.nullness.compatqual.NullableType; -/** - * The result of a {@link TrackSelector} operation. - */ +/** The result of a {@link TrackSelector} operation. */ public final class TrackSelectorResult { /** The number of selections in the result. Greater than or equal to zero. */ @@ -32,10 +30,8 @@ public final class TrackSelectorResult { * renderer should be disabled. */ public final @NullableType RendererConfiguration[] rendererConfigurations; - /** - * A {@link TrackSelectionArray} containing the track selection for each renderer. - */ - public final TrackSelectionArray selections; + /** A {@link TrackSelection} array containing the track selection for each renderer. */ + public final @NullableType TrackSelection[] selections; /** * An opaque object that will be returned to {@link TrackSelector#onSelectionActivated(Object)} * should the selections be activated. @@ -45,7 +41,7 @@ public final class TrackSelectorResult { /** * @param rendererConfigurations A {@link RendererConfiguration} for each renderer. A null entry * indicates the corresponding renderer should be disabled. - * @param selections A {@link TrackSelectionArray} containing the selection for each renderer. + * @param selections A {@link TrackSelection} array containing the selection for each renderer. * @param info An opaque object that will be returned to {@link * TrackSelector#onSelectionActivated(Object)} should the selection be activated. May be * {@code null}. @@ -55,7 +51,7 @@ public final class TrackSelectorResult { @NullableType TrackSelection[] selections, @Nullable Object info) { this.rendererConfigurations = rendererConfigurations; - this.selections = new TrackSelectionArray(selections); + this.selections = selections.clone(); this.info = info; length = rendererConfigurations.length; } @@ -100,7 +96,6 @@ public final class TrackSelectorResult { return false; } return Util.areEqual(rendererConfigurations[index], other.rendererConfigurations[index]) - && Util.areEqual(selections.get(index), other.selections.get(index)); + && Util.areEqual(selections[index], other.selections[index]); } - } diff --git a/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java b/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java index e1ff3002eb..9aebfb7718 100644 --- a/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java +++ b/library/core/src/test/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelectorTest.java @@ -323,7 +323,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, formatWithSelectionFlag); + assertFixedSelection(result.selections[0], trackGroups, formatWithSelectionFlag); } /** Tests that adaptive audio track selections respect the maximum audio bitrate. */ @@ -341,25 +341,25 @@ public final class DefaultTrackSelectorTest { TrackSelectorResult result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 2, 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 2, 0, 1); trackSelector.setParameters( trackSelector.buildUponParameters().setMaxAudioBitrate(256 * 1024 - 1)); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); trackSelector.setParameters(trackSelector.buildUponParameters().setMaxAudioBitrate(192 * 1024)); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); trackSelector.setParameters( trackSelector.buildUponParameters().setMaxAudioBitrate(192 * 1024 - 1)); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups.get(0), 1); + assertFixedSelection(result.selections[0], trackGroups.get(0), 1); trackSelector.setParameters(trackSelector.buildUponParameters().setMaxAudioBitrate(10)); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups.get(0), 1); + assertFixedSelection(result.selections[0], trackGroups.get(0), 1); } /** @@ -380,7 +380,7 @@ public final class DefaultTrackSelectorTest { wrapFormats(frAudioFormat, enAudioFormat), periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, enAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, enAudioFormat); } /** @@ -408,7 +408,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, moreRoleFlags); + assertFixedSelection(result.selections[0], trackGroups, moreRoleFlags); } /** @@ -429,7 +429,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, defaultFormat); + assertFixedSelection(result.selections[0], trackGroups, defaultFormat); } /** @@ -449,7 +449,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, firstFormat); + assertFixedSelection(result.selections[0], trackGroups, firstFormat); } /** @@ -471,7 +471,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, enNonDefaultFormat); + assertFixedSelection(result.selections[0], trackGroups, enNonDefaultFormat); } /** @@ -497,7 +497,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, supportedFormat); + assertFixedSelection(result.selections[0], trackGroups, supportedFormat); } /** @@ -515,7 +515,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, AUDIO_FORMAT); + assertFixedSelection(result.selections[0], trackGroups, AUDIO_FORMAT); } /** @@ -536,7 +536,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); } /** @@ -563,7 +563,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, supportedFormat); + assertFixedSelection(result.selections[0], trackGroups, supportedFormat); } /** @@ -591,7 +591,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, supportedFrFormat); + assertFixedSelection(result.selections[0], trackGroups, supportedFrFormat); } /** @@ -626,7 +626,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, supportedFrFormat); + assertFixedSelection(result.selections[0], trackGroups, supportedFrFormat); } /** @@ -646,7 +646,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherChannelFormat); + assertFixedSelection(result.selections[0], trackGroups, higherChannelFormat); } /** @@ -666,7 +666,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherSampleRateFormat); + assertFixedSelection(result.selections[0], trackGroups, higherSampleRateFormat); } /** @@ -687,7 +687,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, higherBitrateFormat); } /** @@ -709,7 +709,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, firstLanguageFormat); + assertFixedSelection(result.selections[0], trackGroups, firstLanguageFormat); } /** @@ -733,7 +733,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherChannelLowerSampleRateFormat); + assertFixedSelection(result.selections[0], trackGroups, higherChannelLowerSampleRateFormat); } /** @@ -756,7 +756,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherSampleRateLowerBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, higherSampleRateLowerBitrateFormat); } /** @@ -776,7 +776,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerChannelFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerChannelFormat); } /** @@ -796,7 +796,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerSampleRateFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerSampleRateFormat); } /** @@ -816,7 +816,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerBitrateFormat); } /** @@ -841,7 +841,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerChannelHigherSampleRateFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerChannelHigherSampleRateFormat); } /** @@ -865,7 +865,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerSampleRateHigherBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerSampleRateHigherBitrateFormat); } /** Tests text track selection flags. */ @@ -885,12 +885,12 @@ public final class DefaultTrackSelectorTest { TrackGroupArray trackGroups = wrapFormats(forcedOnly, forcedDefault, defaultOnly, noFlag); TrackSelectorResult result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, forcedDefault); + assertFixedSelection(result.selections[0], trackGroups, forcedDefault); // Ditto. trackGroups = wrapFormats(forcedOnly, noFlag, defaultOnly); result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, defaultOnly); + assertFixedSelection(result.selections[0], trackGroups, defaultOnly); // Default flags are disabled and no language preference is provided, so no text track is // selected. @@ -898,7 +898,7 @@ public final class DefaultTrackSelectorTest { trackSelector.setParameters( defaultParameters.buildUpon().setDisabledTextTrackSelectionFlags(C.SELECTION_FLAG_DEFAULT)); result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); // All selection flags are disabled and there is no language preference, so nothing should be // selected. @@ -910,13 +910,13 @@ public final class DefaultTrackSelectorTest { .setDisabledTextTrackSelectionFlags( C.SELECTION_FLAG_DEFAULT | C.SELECTION_FLAG_FORCED)); result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); // There is a preferred language, so a language-matching track flagged as default should // be selected, and the one without forced flag should be preferred. trackSelector.setParameters(defaultParameters.buildUpon().setPreferredTextLanguage("eng")); result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, defaultOnly); + assertFixedSelection(result.selections[0], trackGroups, defaultOnly); // Same as above, but the default flag is disabled. If multiple tracks match the preferred // language, those not flagged as forced are preferred, as they likely include the contents of @@ -928,7 +928,7 @@ public final class DefaultTrackSelectorTest { .buildUpon() .setDisabledTextTrackSelectionFlags(C.SELECTION_FLAG_DEFAULT)); result = trackSelector.selectTracks(textRendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, noFlag); + assertFixedSelection(result.selections[0], trackGroups, noFlag); } /** @@ -957,23 +957,23 @@ public final class DefaultTrackSelectorTest { TrackGroupArray trackGroups = wrapFormats(noLanguageAudio, forcedNoLanguage); TrackSelectorResult result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(1), trackGroups, forcedNoLanguage); + assertFixedSelection(result.selections[1], trackGroups, forcedNoLanguage); // No forced text track should be selected because none of the forced text tracks' languages // matches the selected audio language. trackGroups = wrapFormats(noLanguageAudio, forcedEnglish, forcedGerman); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(1)); + assertNoSelection(result.selections[1]); // The audio declares german. The german forced track should be selected. trackGroups = wrapFormats(germanAudio, forcedGerman, forcedEnglish); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(1), trackGroups, forcedGerman); + assertFixedSelection(result.selections[1], trackGroups, forcedGerman); // Ditto trackGroups = wrapFormats(germanAudio, forcedEnglish, forcedGerman); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(1), trackGroups, forcedGerman); + assertFixedSelection(result.selections[1], trackGroups, forcedGerman); } /** @@ -995,34 +995,34 @@ public final class DefaultTrackSelectorTest { TrackGroupArray trackGroups = wrapFormats(spanish, german, undeterminedUnd, undeterminedNull); TrackSelectorResult result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); trackSelector.setParameters( defaultParameters.buildUpon().setSelectUndeterminedTextLanguage(true)); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, undeterminedUnd); + assertFixedSelection(result.selections[0], trackGroups, undeterminedUnd); ParametersBuilder builder = defaultParameters.buildUpon().setPreferredTextLanguage("spa"); trackSelector.setParameters(builder); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, spanish); + assertFixedSelection(result.selections[0], trackGroups, spanish); trackGroups = wrapFormats(german, undeterminedUnd, undeterminedNull); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); trackSelector.setParameters(builder.setSelectUndeterminedTextLanguage(true)); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, undeterminedUnd); + assertFixedSelection(result.selections[0], trackGroups, undeterminedUnd); trackGroups = wrapFormats(german, undeterminedNull); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, undeterminedNull); + assertFixedSelection(result.selections[0], trackGroups, undeterminedNull); trackGroups = wrapFormats(german); result = trackSelector.selectTracks(textRendererCapabilites, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); } /** Tests audio track selection when there are multiple audio renderers. */ @@ -1053,20 +1053,20 @@ public final class DefaultTrackSelectorTest { // Without an explicit language preference, nothing should be selected. TrackSelectorResult result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); - assertNoSelection(result.selections.get(1)); + assertNoSelection(result.selections[0]); + assertNoSelection(result.selections[1]); // Explicit language preference for english. First renderer should be used. trackSelector.setParameters(defaultParameters.buildUpon().setPreferredTextLanguage("en")); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, english); - assertNoSelection(result.selections.get(1)); + assertFixedSelection(result.selections[0], trackGroups, english); + assertNoSelection(result.selections[1]); // Explicit language preference for German. Second renderer should be used. trackSelector.setParameters(defaultParameters.buildUpon().setPreferredTextLanguage("de")); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); - assertFixedSelection(result.selections.get(1), trackGroups, german); + assertNoSelection(result.selections[0]); + assertFixedSelection(result.selections[1], trackGroups, german); } /** @@ -1098,7 +1098,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, lowerBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, lowerBitrateFormat); } /** @@ -1130,7 +1130,7 @@ public final class DefaultTrackSelectorTest { trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, higherBitrateFormat); + assertFixedSelection(result.selections[0], trackGroups, higherBitrateFormat); } @Test @@ -1143,7 +1143,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); } @Test @@ -1174,7 +1174,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 6); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 6); } @Test @@ -1189,7 +1189,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups.get(0), /* expectedTrack= */ 0); + assertFixedSelection(result.selections[0], trackGroups.get(0), /* expectedTrack= */ 0); } @Test @@ -1206,7 +1206,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, highSampleRateAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, highSampleRateAudioFormat); // The same applies if the tracks are provided in the opposite order. trackGroups = singleTrackGroup(lowSampleRateAudioFormat, highSampleRateAudioFormat); @@ -1214,7 +1214,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, highSampleRateAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, highSampleRateAudioFormat); // If we explicitly enable mixed sample rate adaptiveness, expect an adaptive selection. trackSelector.setParameters( @@ -1223,7 +1223,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); } @Test @@ -1239,7 +1239,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, aacAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, aacAudioFormat); // The same applies if the tracks are provided in the opposite order. trackGroups = singleTrackGroup(opusAudioFormat, aacAudioFormat); @@ -1247,7 +1247,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, opusAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, opusAudioFormat); // If we explicitly enable mixed mime type adaptiveness, expect an adaptive selection. trackSelector.setParameters( @@ -1256,7 +1256,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); } @Test @@ -1272,7 +1272,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, surroundAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, surroundAudioFormat); // The same applies if the tracks are provided in the opposite order. trackGroups = singleTrackGroup(surroundAudioFormat, stereoAudioFormat); @@ -1280,7 +1280,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, surroundAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, surroundAudioFormat); // If we constrain the channel count to 4 we expect a fixed selection containing the track with // fewer channels. @@ -1289,7 +1289,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, stereoAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, stereoAudioFormat); // If we constrain the channel count to 2 we expect a fixed selection containing the track with // fewer channels. @@ -1298,7 +1298,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, stereoAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, stereoAudioFormat); // If we constrain the channel count to 1 we expect a fixed selection containing the track with // fewer channels. @@ -1307,7 +1307,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, stereoAudioFormat); + assertFixedSelection(result.selections[0], trackGroups, stereoAudioFormat); // If we disable exceeding of constraints we expect no selection. trackSelector.setParameters( @@ -1319,7 +1319,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertNoSelection(result.selections.get(0)); + assertNoSelection(result.selections[0]); } @Test @@ -1343,7 +1343,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 1, 2); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 1, 2); } /** Tests audio track selection when there are multiple audio renderers. */ @@ -1374,20 +1374,20 @@ public final class DefaultTrackSelectorTest { TrackGroupArray trackGroups = wrapFormats(english, german); TrackSelectorResult result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, english); - assertNoSelection(result.selections.get(1)); + assertFixedSelection(result.selections[0], trackGroups, english); + assertNoSelection(result.selections[1]); // Explicit language preference for english. First renderer should be used. trackSelector.setParameters(defaultParameters.buildUpon().setPreferredAudioLanguage("en")); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertFixedSelection(result.selections.get(0), trackGroups, english); - assertNoSelection(result.selections.get(1)); + assertFixedSelection(result.selections[0], trackGroups, english); + assertNoSelection(result.selections[1]); // Explicit language preference for German. Second renderer should be used. trackSelector.setParameters(defaultParameters.buildUpon().setPreferredAudioLanguage("de")); result = trackSelector.selectTracks(rendererCapabilities, trackGroups, periodId, TIMELINE); - assertNoSelection(result.selections.get(0)); - assertFixedSelection(result.selections.get(1), trackGroups, german); + assertNoSelection(result.selections[0]); + assertFixedSelection(result.selections[1], trackGroups, german); } @Test @@ -1400,7 +1400,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); } @Test @@ -1424,7 +1424,7 @@ public final class DefaultTrackSelectorTest { periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); // If we explicitly disable non-seamless adaptiveness, expect a fixed selection. trackSelector.setParameters( @@ -1436,7 +1436,7 @@ public final class DefaultTrackSelectorTest { periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups.get(0), 0); + assertFixedSelection(result.selections[0], trackGroups.get(0), 0); } @Test @@ -1452,7 +1452,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, h264VideoFormat); + assertFixedSelection(result.selections[0], trackGroups, h264VideoFormat); // The same applies if the tracks are provided in the opposite order. trackGroups = singleTrackGroup(h265VideoFormat, h264VideoFormat); @@ -1460,7 +1460,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, h265VideoFormat); + assertFixedSelection(result.selections[0], trackGroups, h265VideoFormat); // If we explicitly enable mixed mime type adaptiveness, expect an adaptive selection. trackSelector.setParameters( @@ -1469,7 +1469,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 0, 1); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 0, 1); } @Test @@ -1493,7 +1493,7 @@ public final class DefaultTrackSelectorTest { new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertAdaptiveSelection(result.selections.get(0), trackGroups.get(0), 1, 2); + assertAdaptiveSelection(result.selections[0], trackGroups.get(0), 1, 2); } @Test @@ -1518,9 +1518,9 @@ public final class DefaultTrackSelectorTest { assertThat(result.length).isEqualTo(2); assertAdaptiveSelection( - result.selections.get(0), trackGroups.get(0), /* expectedTracks...= */ 1, 0); + result.selections[0], trackGroups.get(0), /* expectedTracks...= */ 1, 0); assertAdaptiveSelection( - result.selections.get(1), trackGroups.get(1), /* expectedTracks...= */ 1, 0); + result.selections[1], trackGroups.get(1), /* expectedTracks...= */ 1, 0); // Multiple adaptive selection disallowed. trackSelector.setParameters( @@ -1534,8 +1534,8 @@ public final class DefaultTrackSelectorTest { assertThat(result.length).isEqualTo(2); assertAdaptiveSelection( - result.selections.get(0), trackGroups.get(0), /* expectedTracks...= */ 1, 0); - assertFixedSelection(result.selections.get(1), trackGroups.get(1), /* expectedTrack= */ 1); + result.selections[0], trackGroups.get(0), /* expectedTracks...= */ 1, 0); + assertFixedSelection(result.selections[1], trackGroups.get(1), /* expectedTrack= */ 1); } @Test @@ -1552,7 +1552,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatVp9); + assertFixedSelection(result.selections[0], trackGroups, formatVp9); trackSelector.setParameters( trackSelector @@ -1562,7 +1562,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatVp9); + assertFixedSelection(result.selections[0], trackGroups, formatVp9); trackSelector.setParameters( trackSelector @@ -1572,7 +1572,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatH264); + assertFixedSelection(result.selections[0], trackGroups, formatH264); // Select first in the list if no preference is specified. trackSelector.setParameters( @@ -1581,7 +1581,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {VIDEO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatAv1); + assertFixedSelection(result.selections[0], trackGroups, formatAv1); } @Test @@ -1598,7 +1598,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatAc4); + assertFixedSelection(result.selections[0], trackGroups, formatAc4); trackSelector.setParameters( trackSelector @@ -1608,7 +1608,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatAc4); + assertFixedSelection(result.selections[0], trackGroups, formatAc4); trackSelector.setParameters( trackSelector @@ -1618,7 +1618,7 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatEAc3); + assertFixedSelection(result.selections[0], trackGroups, formatEAc3); // Select first in the list if no preference is specified. trackSelector.setParameters( @@ -1627,13 +1627,13 @@ public final class DefaultTrackSelectorTest { trackSelector.selectTracks( new RendererCapabilities[] {AUDIO_CAPABILITIES}, trackGroups, periodId, TIMELINE); assertThat(result.length).isEqualTo(1); - assertFixedSelection(result.selections.get(0), trackGroups, formatAac); + assertFixedSelection(result.selections[0], trackGroups, formatAac); } private static void assertSelections(TrackSelectorResult result, TrackSelection[] expected) { assertThat(result.length).isEqualTo(expected.length); for (int i = 0; i < expected.length; i++) { - assertThat(result.selections.get(i)).isEqualTo(expected[i]); + assertThat(result.selections[i]).isEqualTo(expected[i]); } } @@ -1771,11 +1771,11 @@ public final class DefaultTrackSelectorTest { @Capabilities private final int supportValue; /** - * Returns {@link FakeRendererCapabilities} that advertises adaptive support for all - * tracks of the given type. + * Returns {@link FakeRendererCapabilities} that advertises adaptive support for all tracks of + * the given type. * * @param trackType the track type of all formats that this renderer capabilities advertises - * support for. + * support for. */ FakeRendererCapabilities(int trackType) { this( @@ -1820,7 +1820,6 @@ public final class DefaultTrackSelectorTest { public int supportsMixedMimeTypeAdaptation() { return ADAPTIVE_SEAMLESS; } - } /** @@ -1869,7 +1868,5 @@ public final class DefaultTrackSelectorTest { public int supportsMixedMimeTypeAdaptation() { return ADAPTIVE_SEAMLESS; } - } - }