From 7e0296fa7c081cd8960eb61593297ea5701c78d5 Mon Sep 17 00:00:00 2001 From: Marc Baechinger Date: Mon, 19 Jun 2023 16:25:40 +0100 Subject: [PATCH] Merge pull request #436 from jaeho-lee104:feature/improve_condition PiperOrigin-RevId: 540875285 (cherry picked from commit af69d5822ae4df4a2a9dec2706a49c15f5112d3d) --- .../exoplayer/trackselection/AdaptiveTrackSelection.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java index 91173edc35..dd9ccf6e9f 100644 --- a/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java +++ b/libraries/exoplayer/src/main/java/androidx/media3/exoplayer/trackselection/AdaptiveTrackSelection.java @@ -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);