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 8da37e7f8f..cac29daf5b 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 @@ -38,8 +38,8 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { private static final String TAG = "SsaDecoder"; - private static final Pattern SSA_TIMECODE_PATTERN = Pattern.compile( - "(?:(\\d+):)?(\\d+):(\\d+)(?::|\\.)(\\d+)"); + private static final Pattern SSA_TIMECODE_PATTERN = + Pattern.compile("(?:(\\d+):)?(\\d+):(\\d+)[:.](\\d+)"); private static final String FORMAT_LINE_PREFIX = "Format: "; private static final String DIALOGUE_LINE_PREFIX = "Dialogue: "; @@ -196,10 +196,11 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { } } - String text = lineValues[formatTextIndex] - .replaceAll("\\{.*?\\}", "") - .replaceAll("\\\\N", "\n") - .replaceAll("\\\\n", "\n"); + String text = + lineValues[formatTextIndex] + .replaceAll("\\{.*?}", "") + .replaceAll("\\\\N", "\n") + .replaceAll("\\\\n", "\n"); cues.add(new Cue(text)); cueTimesUs.add(startTimeUs); if (endTimeUs != C.TIME_UNSET) { diff --git a/library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttParserUtil.java b/library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttParserUtil.java index 22aee60a9c..1674e9345c 100644 --- a/library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttParserUtil.java +++ b/library/core/src/main/java/com/google/android/exoplayer2/text/webvtt/WebvttParserUtil.java @@ -26,7 +26,7 @@ import java.util.regex.Pattern; */ public final class WebvttParserUtil { - private static final Pattern COMMENT = Pattern.compile("^NOTE((\u0020|\u0009).*)?$"); + private static final Pattern COMMENT = Pattern.compile("^NOTE([ \t].*)?$"); private static final String WEBVTT_HEADER = "WEBVTT"; private WebvttParserUtil() {}