Fix some lint warnings
------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=164105662
This commit is contained in:
parent
78cdd08684
commit
db99187381
@ -95,7 +95,7 @@ import com.google.android.exoplayer2.util.Assertions;
|
|||||||
* of the on-demand stream ends, playback of the live stream will start from its default position
|
* of the on-demand stream ends, playback of the live stream will start from its default position
|
||||||
* near the live edge.
|
* near the live edge.
|
||||||
*
|
*
|
||||||
* <h3 id="single-file">On-demand stream with mid-roll ads</h3>
|
* <h3 id="single-file-midrolls">On-demand stream with mid-roll ads</h3>
|
||||||
* <p align="center">
|
* <p align="center">
|
||||||
* <img src="doc-files/timeline-single-file-midrolls.svg" alt="Example timeline for an on-demand
|
* <img src="doc-files/timeline-single-file-midrolls.svg" alt="Example timeline for an on-demand
|
||||||
* stream with mid-roll ad groups">
|
* stream with mid-roll ad groups">
|
||||||
|
@ -23,6 +23,7 @@ import com.google.android.exoplayer2.text.SimpleSubtitleDecoder;
|
|||||||
import com.google.android.exoplayer2.util.Assertions;
|
import com.google.android.exoplayer2.util.Assertions;
|
||||||
import com.google.android.exoplayer2.util.LongArray;
|
import com.google.android.exoplayer2.util.LongArray;
|
||||||
import com.google.android.exoplayer2.util.ParsableByteArray;
|
import com.google.android.exoplayer2.util.ParsableByteArray;
|
||||||
|
import com.google.android.exoplayer2.util.Util;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.regex.Matcher;
|
import java.util.regex.Matcher;
|
||||||
@ -132,7 +133,7 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
|
|||||||
formatEndIndex = C.INDEX_UNSET;
|
formatEndIndex = C.INDEX_UNSET;
|
||||||
formatTextIndex = C.INDEX_UNSET;
|
formatTextIndex = C.INDEX_UNSET;
|
||||||
for (int i = 0; i < formatKeyCount; i++) {
|
for (int i = 0; i < formatKeyCount; i++) {
|
||||||
String key = values[i].trim().toLowerCase();
|
String key = Util.toLowerInvariant(values[i].trim());
|
||||||
switch (key) {
|
switch (key) {
|
||||||
case "start":
|
case "start":
|
||||||
formatStartIndex = i;
|
formatStartIndex = i;
|
||||||
|
@ -290,7 +290,7 @@ public final class TtmlDecoder extends SimpleSubtitleDecoder {
|
|||||||
String displayAlign = XmlPullParserUtil.getAttributeValue(xmlParser,
|
String displayAlign = XmlPullParserUtil.getAttributeValue(xmlParser,
|
||||||
TtmlNode.ATTR_TTS_DISPLAY_ALIGN);
|
TtmlNode.ATTR_TTS_DISPLAY_ALIGN);
|
||||||
if (displayAlign != null) {
|
if (displayAlign != null) {
|
||||||
switch (displayAlign.toLowerCase()) {
|
switch (Util.toLowerInvariant(displayAlign)) {
|
||||||
case "center":
|
case "center":
|
||||||
lineAnchor = Cue.ANCHOR_TYPE_MIDDLE;
|
lineAnchor = Cue.ANCHOR_TYPE_MIDDLE;
|
||||||
line += height / 2;
|
line += height / 2;
|
||||||
|
@ -895,7 +895,7 @@ public final class Util {
|
|||||||
*/
|
*/
|
||||||
@C.ContentType
|
@C.ContentType
|
||||||
public static int inferContentType(String fileName) {
|
public static int inferContentType(String fileName) {
|
||||||
fileName = fileName.toLowerCase();
|
fileName = Util.toLowerInvariant(fileName);
|
||||||
if (fileName.endsWith(".mpd")) {
|
if (fileName.endsWith(".mpd")) {
|
||||||
return C.TYPE_DASH;
|
return C.TYPE_DASH;
|
||||||
} else if (fileName.endsWith(".m3u8")) {
|
} else if (fileName.endsWith(".m3u8")) {
|
||||||
|
@ -39,7 +39,6 @@ import java.io.IOException;
|
|||||||
import java.math.BigInteger;
|
import java.math.BigInteger;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Locale;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Source of Hls (possibly adaptive) chunks.
|
* Source of Hls (possibly adaptive) chunks.
|
||||||
@ -366,7 +365,7 @@ import java.util.Locale;
|
|||||||
|
|
||||||
private void setEncryptionData(Uri keyUri, String iv, byte[] secretKey) {
|
private void setEncryptionData(Uri keyUri, String iv, byte[] secretKey) {
|
||||||
String trimmedIv;
|
String trimmedIv;
|
||||||
if (iv.toLowerCase(Locale.getDefault()).startsWith("0x")) {
|
if (Util.toLowerInvariant(iv).startsWith("0x")) {
|
||||||
trimmedIv = iv.substring(2);
|
trimmedIv = iv.substring(2);
|
||||||
} else {
|
} else {
|
||||||
trimmedIv = iv;
|
trimmedIv = iv;
|
||||||
|
@ -15,6 +15,7 @@
|
|||||||
*/
|
*/
|
||||||
package com.google.android.exoplayer2.ui;
|
package com.google.android.exoplayer2.ui;
|
||||||
|
|
||||||
|
import android.annotation.SuppressLint;
|
||||||
import android.widget.TextView;
|
import android.widget.TextView;
|
||||||
import com.google.android.exoplayer2.ExoPlaybackException;
|
import com.google.android.exoplayer2.ExoPlaybackException;
|
||||||
import com.google.android.exoplayer2.Format;
|
import com.google.android.exoplayer2.Format;
|
||||||
@ -25,6 +26,7 @@ import com.google.android.exoplayer2.Timeline;
|
|||||||
import com.google.android.exoplayer2.decoder.DecoderCounters;
|
import com.google.android.exoplayer2.decoder.DecoderCounters;
|
||||||
import com.google.android.exoplayer2.source.TrackGroupArray;
|
import com.google.android.exoplayer2.source.TrackGroupArray;
|
||||||
import com.google.android.exoplayer2.trackselection.TrackSelectionArray;
|
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
|
* A helper class for periodically updating a {@link TextView} with debug information obtained from
|
||||||
@ -125,6 +127,7 @@ public final class DebugTextViewHelper implements Runnable, Player.EventListener
|
|||||||
|
|
||||||
// Private methods.
|
// Private methods.
|
||||||
|
|
||||||
|
@SuppressLint("SetTextI18n")
|
||||||
private void updateAndPost() {
|
private void updateAndPost() {
|
||||||
textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getVideoString()
|
textView.setText(getPlayerStateString() + getPlayerWindowIndexString() + getVideoString()
|
||||||
+ getAudioString());
|
+ getAudioString());
|
||||||
@ -192,7 +195,7 @@ public final class DebugTextViewHelper implements Runnable, Player.EventListener
|
|||||||
|
|
||||||
private static String getPixelAspectRatioString(float pixelAspectRatio) {
|
private static String getPixelAspectRatioString(float pixelAspectRatio) {
|
||||||
return pixelAspectRatio == Format.NO_VALUE || pixelAspectRatio == 1f ? ""
|
return pixelAspectRatio == Format.NO_VALUE || pixelAspectRatio == 1f ? ""
|
||||||
: (" par:" + String.format("%.02f", pixelAspectRatio));
|
: (" par:" + String.format(Locale.US, "%.02f", pixelAspectRatio));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user