diff --git a/library/core/src/main/java/com/google/android/exoplayer2/Timeline.java b/library/core/src/main/java/com/google/android/exoplayer2/Timeline.java index 7ce23e67ece..414c0804ad2 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/Timeline.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/Timeline.java @@ -95,7 +95,7 @@ * of the on-demand stream ends, playback of the live stream will start from its default position * near the live edge. * - *

On-demand stream with mid-roll ads

+ *

On-demand stream with mid-roll ads

*

* Example timeline for an on-demand
  *       stream with mid-roll ad groups diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/ssa/SsaDecoder.java b/library/core/src/main/java/com/google/android/exoplayer2/text/ssa/SsaDecoder.java index 11489e7b35a..d2f5a67c279 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/text/ssa/SsaDecoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/text/ssa/SsaDecoder.java @@ -23,6 +23,7 @@ import com.google.android.exoplayer2.util.Assertions; import com.google.android.exoplayer2.util.LongArray; import com.google.android.exoplayer2.util.ParsableByteArray; +import com.google.android.exoplayer2.util.Util; import java.util.ArrayList; import java.util.List; import java.util.regex.Matcher; @@ -132,7 +133,7 @@ private void parseFormatLine(String formatLine) { formatEndIndex = C.INDEX_UNSET; formatTextIndex = C.INDEX_UNSET; for (int i = 0; i < formatKeyCount; i++) { - String key = values[i].trim().toLowerCase(); + String key = Util.toLowerInvariant(values[i].trim()); switch (key) { case "start": formatStartIndex = i; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java b/library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java index e438aa18378..a215bf3cc9a 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/text/ttml/TtmlDecoder.java @@ -290,7 +290,7 @@ private TtmlRegion parseRegionAttributes(XmlPullParser xmlParser) { String displayAlign = XmlPullParserUtil.getAttributeValue(xmlParser, TtmlNode.ATTR_TTS_DISPLAY_ALIGN); if (displayAlign != null) { - switch (displayAlign.toLowerCase()) { + switch (Util.toLowerInvariant(displayAlign)) { case "center": lineAnchor = Cue.ANCHOR_TYPE_MIDDLE; line += height / 2; diff --git a/library/core/src/main/java/com/google/android/exoplayer2/util/Util.java b/library/core/src/main/java/com/google/android/exoplayer2/util/Util.java index c00d7fa36c0..b958a54244c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/util/Util.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/util/Util.java @@ -895,7 +895,7 @@ public static int inferContentType(Uri uri) { */ @C.ContentType public static int inferContentType(String fileName) { - fileName = fileName.toLowerCase(); + fileName = Util.toLowerInvariant(fileName); if (fileName.endsWith(".mpd")) { return C.TYPE_DASH; } else if (fileName.endsWith(".m3u8")) { diff --git a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java index 38c3da81947..bca62ed2303 100644 --- a/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java +++ b/library/hls/src/main/java/com/google/android/exoplayer2/source/hls/HlsChunkSource.java @@ -39,7 +39,6 @@ import java.math.BigInteger; import java.util.Arrays; import java.util.List; -import java.util.Locale; /** * Source of Hls (possibly adaptive) chunks. @@ -366,7 +365,7 @@ private EncryptionKeyChunk newEncryptionKeyChunk(Uri keyUri, String iv, int vari private void setEncryptionData(Uri keyUri, String iv, byte[] secretKey) { String trimmedIv; - if (iv.toLowerCase(Locale.getDefault()).startsWith("0x")) { + if (Util.toLowerInvariant(iv).startsWith("0x")) { trimmedIv = iv.substring(2); } else { trimmedIv = iv; diff --git a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java index 8c4bad18628..060780eda2f 100644 --- a/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java +++ b/library/ui/src/main/java/com/google/android/exoplayer2/ui/DebugTextViewHelper.java @@ -15,6 +15,7 @@ */ package com.google.android.exoplayer2.ui; +import android.annotation.SuppressLint; import android.widget.TextView; import com.google.android.exoplayer2.ExoPlaybackException; import com.google.android.exoplayer2.Format; @@ -25,6 +26,7 @@ import com.google.android.exoplayer2.decoder.DecoderCounters; import com.google.android.exoplayer2.source.TrackGroupArray; import com.google.android.exoplayer2.trackselection.TrackSelectionArray; +import java.util.Locale; /** * A helper class for periodically updating a {@link TextView} with debug information obtained from @@ -125,6 +127,7 @@ public void run() { // Private methods. + @SuppressLint("SetTextI18n") private void updateAndPost() { textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getVideoString() + getAudioString()); @@ -192,7 +195,7 @@ private static String getDecoderCountersBufferCountString(DecoderCounters counte private static String getPixelAspectRatioString(float pixelAspectRatio) { return pixelAspectRatio == Format.NO_VALUE || pixelAspectRatio == 1f ? "" - : (" par:" + String.format("%.02f", pixelAspectRatio)); + : (" par:" + String.format(Locale.US, "%.02f", pixelAspectRatio)); } }