mirror of
https://github.com/androidx/media.git
synced 2025-05-14 11:09:53 +08:00
Pick the lowest quality video when capabilities are exceeded
Issue:#2901 ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=158006727
This commit is contained in:
parent
8dca0b9418
commit
10c2d3156b
@ -639,7 +639,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
||||
continue;
|
||||
}
|
||||
int trackScore = isWithinConstraints ? 2 : 1;
|
||||
if (isSupported(trackFormatSupport[trackIndex], false)) {
|
||||
boolean isWithinCapabilities = isSupported(trackFormatSupport[trackIndex], false);
|
||||
if (isWithinCapabilities) {
|
||||
trackScore += WITHIN_RENDERER_CAPABILITIES_BONUS;
|
||||
}
|
||||
boolean selectTrack = trackScore > selectedTrackScore;
|
||||
@ -655,7 +656,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
||||
} else {
|
||||
comparisonResult = compareFormatValues(format.bitrate, selectedBitrate);
|
||||
}
|
||||
selectTrack = isWithinConstraints ? comparisonResult > 0 : comparisonResult < 0;
|
||||
selectTrack = isWithinCapabilities && isWithinConstraints
|
||||
? comparisonResult > 0 : comparisonResult < 0;
|
||||
}
|
||||
if (selectTrack) {
|
||||
selectedGroup = trackGroup;
|
||||
|
Loading…
x
Reference in New Issue
Block a user