From 86efd1944ec6b1506de85ec029f9328378b53260 Mon Sep 17 00:00:00 2001 From: Arnold Szabo Date: Wed, 30 Oct 2019 22:58:32 +0200 Subject: [PATCH] Add jdoc to SSA parsePosition(..) method --- .../android/exoplayer2/text/ssa/SsaDecoder.java | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) 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 181ce47abc..4079a6a433 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 @@ -204,7 +204,6 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { } } - // Parse \pos{x,y} attribute PointF position = parsePosition(lineValues[formatTextIndex]); String text = lineValues[formatTextIndex] @@ -285,10 +284,17 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { return timestampUs; } + /** + * Parses the position of an SSA dialogue line. + * The attribute is expected to be in this form: "\pos{x,y}". + * + * @param line The string to parse. + * @return The parsed position. + */ @Nullable - public static PointF parsePosition(String line){ + private static PointF parsePosition(String line) { Matcher matcher = SSA_POSITION_PATTERN.matcher(line); - if(!matcher.find()){ + if (!matcher.find()) { return null; } float x = Float.parseFloat(matcher.group(1));