Skip to content

Commit 43d1bfe

Browse files
jaeho-lee104tianyif
authored andcommitted
Improve track index adjustment logic by adding index comparison.
1 parent cf21add commit 43d1bfe

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -457,7 +457,8 @@ public void updateSelectedTrack(
457457
previousReason = Iterables.getLast(queue).trackSelectionReason;
458458
}
459459
int newSelectedIndex = determineIdealSelectedIndex(nowMs, chunkDurationUs);
460-
if (!isTrackExcluded(previousSelectedIndex, nowMs)) {
460+
if (newSelectedIndex != previousSelectedIndex
461+
&& !isTrackExcluded(previousSelectedIndex, nowMs)) {
461462
// Revert back to the previous selection if conditions are not suitable for switching.
462463
Format currentFormat = getFormat(previousSelectedIndex);
463464
Format selectedFormat = getFormat(newSelectedIndex);

0 commit comments

Comments
 (0)