public boolean selectTracks() throws ExoPlaybackException { TrackSelectorResult selectorResult = trackSelector.selectTracks(rendererCapabilities, mediaPeriod.getTrackGroups()); if (selectorResult.isEquivalent(periodTrackSelectorResult)) { return false; } trackSelectorResult = selectorResult; return true; }
private void updatePeriodTrackSelectorResult(TrackSelectorResult trackSelectorResult) { if (periodTrackSelectorResult != null) { disableTrackSelectionsInResult(periodTrackSelectorResult); } periodTrackSelectorResult = trackSelectorResult; if (periodTrackSelectorResult != null) { enableTrackSelectionsInResult(periodTrackSelectorResult); } }
private void enableTrackSelectionsInResult(TrackSelectorResult trackSelectorResult) { for (int i = 0; i < trackSelectorResult.renderersEnabled.length; i++) { boolean rendererEnabled = trackSelectorResult.renderersEnabled[i]; TrackSelection trackSelection = trackSelectorResult.selections.get(i); if (rendererEnabled && trackSelection != null) { trackSelection.enable(); } } }
private void disableTrackSelectionsInResult(TrackSelectorResult trackSelectorResult) { for (int i = 0; i < trackSelectorResult.renderersEnabled.length; i++) { boolean rendererEnabled = trackSelectorResult.renderersEnabled[i]; TrackSelection trackSelection = trackSelectorResult.selections.get(i); if (rendererEnabled && trackSelection != null) { trackSelection.disable(); } } }