mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00: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
cc748c30c7
commit
df5e75b76c
1 changed files with 4 additions and 2 deletions
|
|
@ -639,7 +639,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
int trackScore = isWithinConstraints ? 2 : 1;
|
int trackScore = isWithinConstraints ? 2 : 1;
|
||||||
if (isSupported(trackFormatSupport[trackIndex], false)) {
|
boolean isWithinCapabilities = isSupported(trackFormatSupport[trackIndex], false);
|
||||||
|
if (isWithinCapabilities) {
|
||||||
trackScore += WITHIN_RENDERER_CAPABILITIES_BONUS;
|
trackScore += WITHIN_RENDERER_CAPABILITIES_BONUS;
|
||||||
}
|
}
|
||||||
boolean selectTrack = trackScore > selectedTrackScore;
|
boolean selectTrack = trackScore > selectedTrackScore;
|
||||||
|
|
@ -655,7 +656,8 @@ public class DefaultTrackSelector extends MappingTrackSelector {
|
||||||
} else {
|
} else {
|
||||||
comparisonResult = compareFormatValues(format.bitrate, selectedBitrate);
|
comparisonResult = compareFormatValues(format.bitrate, selectedBitrate);
|
||||||
}
|
}
|
||||||
selectTrack = isWithinConstraints ? comparisonResult > 0 : comparisonResult < 0;
|
selectTrack = isWithinCapabilities && isWithinConstraints
|
||||||
|
? comparisonResult > 0 : comparisonResult < 0;
|
||||||
}
|
}
|
||||||
if (selectTrack) {
|
if (selectTrack) {
|
||||||
selectedGroup = trackGroup;
|
selectedGroup = trackGroup;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue