Skip to content

Commit

Permalink
Treat NO_VALUE as zero when adding up total required bitrate
Browse files Browse the repository at this point in the history
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#10664
PiperOrigin-RevId: 480048126
  • Loading branch information
tonihei authored and marcbaechinger committed Oct 20, 2022
1 parent a366590 commit af19e0e
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -753,7 +753,8 @@ private static long[][] getSortedTrackBitrates(@NullableType Definition[] defini
}
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]);
}
Expand Down

0 comments on commit af19e0e

Please sign in to comment.