Commit af19e0ea by tonihei Committed by Marc Baechinger

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
parent a366590a
......@@ -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]);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment