mirror of
https://github.com/samsonjs/media.git
synced 2026-04-27 15:07:40 +00:00
Improve track index adjustment logic by adding index comparison.
This commit is contained in:
parent
cf21add916
commit
43d1bfe11a
1 changed files with 2 additions and 1 deletions
|
|
@ -457,7 +457,8 @@ public class AdaptiveTrackSelection extends BaseTrackSelection {
|
||||||
previousReason = Iterables.getLast(queue).trackSelectionReason;
|
previousReason = Iterables.getLast(queue).trackSelectionReason;
|
||||||
}
|
}
|
||||||
int newSelectedIndex = determineIdealSelectedIndex(nowMs, chunkDurationUs);
|
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.
|
// Revert back to the previous selection if conditions are not suitable for switching.
|
||||||
Format currentFormat = getFormat(previousSelectedIndex);
|
Format currentFormat = getFormat(previousSelectedIndex);
|
||||||
Format selectedFormat = getFormat(newSelectedIndex);
|
Format selectedFormat = getFormat(newSelectedIndex);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue