Really fix the NPE in ExoPlayer.

-------------
Created by MOE: https://github.com/google/moe
MOE_MIGRATED_REVID=176821463
This commit is contained in:
baiming 2017-11-24 01:32:44 -08:00 committed by Oliver Woodman
parent 91bcde033c
commit 5cd8869646

View file

@ -947,10 +947,12 @@ import java.io.IOException;
MediaPeriodHolder periodHolder =
playingPeriodHolder != null ? playingPeriodHolder : loadingPeriodHolder;
while (periodHolder != null) {
TrackSelection[] trackSelections = periodHolder.trackSelectorResult.selections.getAll();
for (TrackSelection trackSelection : trackSelections) {
if (trackSelection != null) {
trackSelection.onPlaybackSpeed(playbackSpeed);
if (periodHolder.trackSelectorResult != null) {
TrackSelection[] trackSelections = periodHolder.trackSelectorResult.selections.getAll();
for (TrackSelection trackSelection : trackSelections) {
if (trackSelection != null) {
trackSelection.onPlaybackSpeed(playbackSpeed);
}
}
}
periodHolder = periodHolder.next;