mirror of
https://github.com/androidx/media.git
synced 2025-05-05 06:30:24 +08:00
Treat NO_VALUE as zero when adding up total required bitrate
We currently use the literal -1 (=NO_VALUE) when adding up the total. Tracks without known bitrate can be ignored in the calculation, but we should use an explicit value of 0. #minor-release Issue: google/ExoPlayer#10664 PiperOrigin-RevId: 480048126
This commit is contained in:
parent
a366590a04
commit
af19e0ea89
@ -753,7 +753,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
|
||||
}
|
||||
trackBitrates[i] = new long[definition.tracks.length];
|
||||
for (int j = 0; j < definition.tracks.length; j++) {
|
||||
trackBitrates[i][j] = definition.group.getFormat(definition.tracks[j]).bitrate;
|
||||
long bitrate = definition.group.getFormat(definition.tracks[j]).bitrate;
|
||||
trackBitrates[i][j] = bitrate == Format.NO_VALUE ? 0 : bitrate;
|
||||
}
|
||||
Arrays.sort(trackBitrates[i]);
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user