mirror of
https://github.com/samsonjs/media.git
synced 2026-04-02 10:45:51 +00:00
Don't invoke adaptiveTrack with 0 or 1 representations.
0 will crash. 1 is pointless.
This commit is contained in:
parent
e8895c8746
commit
979fd083b4
2 changed files with 10 additions and 4 deletions
|
|
@ -84,8 +84,11 @@ public final class DefaultDashTrackSelector implements DashTrackSelector {
|
|||
} else {
|
||||
representations = Util.firstIntegersArray(adaptationSet.representations.size());
|
||||
}
|
||||
output.adaptiveTrack(manifest, periodIndex, i, representations);
|
||||
for (int j = 0; j < representations.length; j++) {
|
||||
int representationCount = representations.length;
|
||||
if (representationCount > 1) {
|
||||
output.adaptiveTrack(manifest, periodIndex, i, representations);
|
||||
}
|
||||
for (int j = 0; j < representationCount; j++) {
|
||||
output.fixedTrack(manifest, periodIndex, i, representations[j]);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
|
|
@ -50,8 +50,11 @@ public final class DefaultSmoothStreamingTrackSelector implements SmoothStreamin
|
|||
if (streamElementType == StreamElement.TYPE_VIDEO) {
|
||||
int[] trackIndices = VideoFormatSelectorUtil.selectVideoFormatsForDefaultDisplay(
|
||||
context, Arrays.asList(manifest.streamElements[i].tracks), null, false);
|
||||
output.adaptiveTrack(manifest, i, trackIndices);
|
||||
for (int j = 0; j < trackIndices.length; j++) {
|
||||
int trackCount = trackIndices.length;
|
||||
if (trackCount > 1) {
|
||||
output.adaptiveTrack(manifest, i, trackIndices);
|
||||
}
|
||||
for (int j = 0; j < trackCount; j++) {
|
||||
output.fixedTrack(manifest, i, trackIndices[j]);
|
||||
}
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Reference in a new issue