Make video auto track selection more readable

This commit is contained in:
Hampton Maxwell 2019-04-03 23:24:02 -07:00 committed by GitHub
parent 2072793ae3
commit da8a202a0f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -975,14 +975,13 @@ class ReactExoplayerView extends FrameLayout implements
groupIndex = getGroupIndexForDefaultLocale(groups);
}
if (groupIndex == C.INDEX_UNSET && trackType == C.TRACK_TYPE_VIDEO) { // Video auto
if (groups.length != 0) {
TrackGroup group = groups.get(0);
tracks = new int[group.length];
groupIndex = 0;
for (int j = 0; j < group.length; j++) {
tracks[j] = j;
}
if (groupIndex == C.INDEX_UNSET && trackType == C.TRACK_TYPE_VIDEO && groups.length != 0) { // Video auto
// Add all tracks as valid options for ABR to choose from
TrackGroup group = groups.get(0);
tracks = new int[group.length];
groupIndex = 0;
for (int j = 0; j < group.length; j++) {
tracks[j] = j;
}
}