Skip to content

Commit

Permalink
Defect fix for issue #1460
Browse files Browse the repository at this point in the history
  • Loading branch information
jake4376 committed Jan 30, 2019
1 parent 5b5ad8e commit 52e34c6
Showing 1 changed file with 7 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -876,7 +876,7 @@ public void setSelectedTrack(int trackType, String type, Dynamic value) {
TrackGroup group = groups.get(i);
for (int j = 0; j < group.length; j++) {
Format format = group.getFormat(j);
if (format.height == value.asInt()) {
if (format.height == height) {
groupIndex = i;
tracks[0] = j;
break;
Expand All @@ -894,14 +894,12 @@ public void setSelectedTrack(int trackType, String type, Dynamic value) {
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
TrackGroup group = groups.get(0);
tracks = new int[group.length];
groupIndex = 0;
for (int j = 0; j < group.length; j++) {
tracks[j] = j;
}
} else if (groupIndex == C.INDEX_UNSET) {
trackSelector.setParameters(disableParameters);
Expand Down

0 comments on commit 52e34c6

Please sign in to comment.