Merge pull request #436 from jaeho-lee104:feature/improve_condition

PiperOrigin-RevId: 540875285
This commit is contained in:
Marc Baechinger 2023-06-19 16:25:40 +01:00
commit af69d5822a

View File

@ -457,7 +457,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
previousReason = Iterables.getLast(queue).trackSelectionReason;
}
int newSelectedIndex = determineIdealSelectedIndex(nowMs, chunkDurationUs);
if (!isTrackExcluded(previousSelectedIndex, nowMs)) {
if (newSelectedIndex != previousSelectedIndex
&& !isTrackExcluded(previousSelectedIndex, nowMs)) {
// Revert back to the previous selection if conditions are not suitable for switching.
Format currentFormat = getFormat(previousSelectedIndex);
Format selectedFormat = getFormat(newSelectedIndex);