diff --git a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java index 4a75b6f722..0f5adab4f5 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/trackselection/DefaultTrackSelector.java @@ -1651,9 +1651,10 @@ public class DefaultTrackSelector extends MappingTrackSelector { } boolean selectTrack = trackScore > selectedTrackScore; if (trackScore == selectedTrackScore) { - if (params.forceLowestBitrate) { + int bitrateComparison = compareFormatValues(format.bitrate, selectedBitrate); + if (params.forceLowestBitrate && bitrateComparison != 0) { // Use bitrate as a tie breaker, preferring the lower bitrate. - selectTrack = compareFormatValues(format.bitrate, selectedBitrate) < 0; + selectTrack = bitrateComparison < 0; } else { // Use the pixel count as a tie breaker (or bitrate if pixel counts are tied). If // we're within constraints prefer a higher pixel count (or bitrate), else prefer a @@ -2173,23 +2174,29 @@ public class DefaultTrackSelector extends MappingTrackSelector { if (this.withinRendererCapabilitiesScore != other.withinRendererCapabilitiesScore) { return compareInts(this.withinRendererCapabilitiesScore, other.withinRendererCapabilitiesScore); - } else if (this.matchLanguageScore != other.matchLanguageScore) { - return compareInts(this.matchLanguageScore, other.matchLanguageScore); - } else if (this.defaultSelectionFlagScore != other.defaultSelectionFlagScore) { - return compareInts(this.defaultSelectionFlagScore, other.defaultSelectionFlagScore); - } else if (parameters.forceLowestBitrate) { - return compareInts(other.bitrate, this.bitrate); - } else { - // If the format are within renderer capabilities, prefer higher values of channel count, - // sample rate and bit rate in that order. Otherwise, prefer lower values. - int resultSign = withinRendererCapabilitiesScore == 1 ? 1 : -1; - if (this.channelCount != other.channelCount) { - return resultSign * compareInts(this.channelCount, other.channelCount); - } else if (this.sampleRate != other.sampleRate) { - return resultSign * compareInts(this.sampleRate, other.sampleRate); - } - return resultSign * compareInts(this.bitrate, other.bitrate); } + if (this.matchLanguageScore != other.matchLanguageScore) { + return compareInts(this.matchLanguageScore, other.matchLanguageScore); + } + if (parameters.forceLowestBitrate) { + int bitrateComparison = compareFormatValues(bitrate, other.bitrate); + if (bitrateComparison != 0) { + return bitrateComparison > 0 ? -1 : 1; + } + } + if (this.defaultSelectionFlagScore != other.defaultSelectionFlagScore) { + return compareInts(this.defaultSelectionFlagScore, other.defaultSelectionFlagScore); + } + // If the formats are within renderer capabilities then prefer higher values of channel count, + // sample rate and bit rate in that order. Otherwise, prefer lower values. + int resultSign = withinRendererCapabilitiesScore == 1 ? 1 : -1; + if (this.channelCount != other.channelCount) { + return resultSign * compareInts(this.channelCount, other.channelCount); + } + if (this.sampleRate != other.sampleRate) { + return resultSign * compareInts(this.sampleRate, other.sampleRate); + } + return resultSign * compareInts(this.bitrate, other.bitrate); } } diff --git a/library/ui/src/main/res/values-ar/strings.xml b/library/ui/src/main/res/values-ar/strings.xml index e64797f7b3..9980191621 100644 --- a/library/ui/src/main/res/values-ar/strings.xml +++ b/library/ui/src/main/res/values-ar/strings.xml @@ -12,7 +12,7 @@ تكرار الكل ترتيب عشوائي وضع ملء الشاشة - Exit VR mode + الخروج من وضع VR تنزيل التنزيلات جارٍ التنزيل. diff --git a/library/ui/src/main/res/values-az/strings.xml b/library/ui/src/main/res/values-az/strings.xml index 31fde9987f..d119531c70 100644 --- a/library/ui/src/main/res/values-az/strings.xml +++ b/library/ui/src/main/res/values-az/strings.xml @@ -12,7 +12,7 @@ Hamısı təkrarlansın Qarışdırın Tam ekran rejimi - Exit VR mode + VR rejimdən çıxın Endirin Endirmələr Endirilir diff --git a/library/ui/src/main/res/values-bs/strings.xml b/library/ui/src/main/res/values-bs/strings.xml index 3bb68d006a..34f445bcca 100644 --- a/library/ui/src/main/res/values-bs/strings.xml +++ b/library/ui/src/main/res/values-bs/strings.xml @@ -12,7 +12,7 @@ Ponovi sve Izmiješaj Način rada preko cijelog ekrana - Exit VR mode + Izlazak iz VR načina Preuzmi Preuzimanja Preuzimanje diff --git a/library/ui/src/main/res/values-fa/strings.xml b/library/ui/src/main/res/values-fa/strings.xml index e923dae795..2f36b5fc3b 100644 --- a/library/ui/src/main/res/values-fa/strings.xml +++ b/library/ui/src/main/res/values-fa/strings.xml @@ -12,7 +12,7 @@ تکرار همه درهم حالت تمام‌صفحه - Exit VR mode + خروج از حالت واقعیت مجازی بارگیری بارگیری‌ها درحال بارگیری diff --git a/library/ui/src/main/res/values-hr/strings.xml b/library/ui/src/main/res/values-hr/strings.xml index 1cba6e162b..d76fef9367 100644 --- a/library/ui/src/main/res/values-hr/strings.xml +++ b/library/ui/src/main/res/values-hr/strings.xml @@ -12,7 +12,7 @@ Ponovi sve Reproduciraj nasumično Prikaz na cijelom zaslonu - Exit VR mode + Izlazak iz VR načina Preuzmi Preuzimanja Preuzimanje diff --git a/library/ui/src/main/res/values-in/strings.xml b/library/ui/src/main/res/values-in/strings.xml index 92c6e055b6..39fcfea559 100644 --- a/library/ui/src/main/res/values-in/strings.xml +++ b/library/ui/src/main/res/values-in/strings.xml @@ -12,7 +12,7 @@ Ulangi semua Acak Mode layar penuh - Exit VR mode + Keluar dari mode VR Download Download Mendownload diff --git a/library/ui/src/main/res/values-ka/strings.xml b/library/ui/src/main/res/values-ka/strings.xml index 06b798baf2..2ec70e9c51 100644 --- a/library/ui/src/main/res/values-ka/strings.xml +++ b/library/ui/src/main/res/values-ka/strings.xml @@ -12,7 +12,7 @@ ყველას გამეორება არეულად დაკვრა სრულეკრანიანი რეჟიმი - Exit VR mode + VR რეჟიმიდან გასვლა ჩამოტვირთვა ჩამოტვირთვები მიმდინარეობს ჩამოტვირთვა diff --git a/library/ui/src/main/res/values-my/strings.xml b/library/ui/src/main/res/values-my/strings.xml index d7aa70c610..124b2826c0 100644 --- a/library/ui/src/main/res/values-my/strings.xml +++ b/library/ui/src/main/res/values-my/strings.xml @@ -12,7 +12,7 @@ အားလုံး ပြန်ကျော့ရန် ရောသမမွှေ မျက်နှာပြင်အပြည့် မုဒ် - Exit VR mode + VR မုဒ်မှထွက်ပါ ဒေါင်းလုဒ် လုပ်ရန် ဒေါင်းလုဒ်များ ဒေါင်းလုဒ်လုပ်နေသည် diff --git a/library/ui/src/main/res/values-sk/strings.xml b/library/ui/src/main/res/values-sk/strings.xml index 99ec680405..39b99e215d 100644 --- a/library/ui/src/main/res/values-sk/strings.xml +++ b/library/ui/src/main/res/values-sk/strings.xml @@ -12,7 +12,7 @@ Opakovať všetko Náhodne prehrávať Režim celej obrazovky - Exit VR mode + Ukončiť režim VR Stiahnuť Stiahnuté Sťahuje sa diff --git a/library/ui/src/main/res/values-sq/strings.xml b/library/ui/src/main/res/values-sq/strings.xml index 2c139f20cb..434ef77f58 100644 --- a/library/ui/src/main/res/values-sq/strings.xml +++ b/library/ui/src/main/res/values-sq/strings.xml @@ -12,7 +12,7 @@ Përsërit të gjitha Përziej Modaliteti me ekran të plotë - Exit VR mode + Dil nga modaliteti VR Shkarko Shkarkimet Po shkarkohet diff --git a/library/ui/src/main/res/values-uz/strings.xml b/library/ui/src/main/res/values-uz/strings.xml index 5275d7bd06..a62bc1a2e8 100644 --- a/library/ui/src/main/res/values-uz/strings.xml +++ b/library/ui/src/main/res/values-uz/strings.xml @@ -12,7 +12,7 @@ Hammasini takrorlash Aralash Butun ekran rejimi - Exit VR mode + VR rejimidan chiqish Yuklab olish Yuklanmalar Yuklab olinmoqda diff --git a/library/ui/src/main/res/values-zu/strings.xml b/library/ui/src/main/res/values-zu/strings.xml index 40a1a6ce29..6be1c61f5e 100644 --- a/library/ui/src/main/res/values-zu/strings.xml +++ b/library/ui/src/main/res/values-zu/strings.xml @@ -12,7 +12,7 @@ Phinda konke Shova Imodi yesikrini esigcwele - Exit VR mode + Phuma kumodi ye-VR Landa Ukulandwa Iyalanda