Commit 86efd194 by Arnold Szabo

Add jdoc to SSA parsePosition(..) method

parent 3b741e59
...@@ -204,7 +204,6 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { ...@@ -204,7 +204,6 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
} }
} }
// Parse \pos{x,y} attribute
PointF position = parsePosition(lineValues[formatTextIndex]); PointF position = parsePosition(lineValues[formatTextIndex]);
String text = lineValues[formatTextIndex] String text = lineValues[formatTextIndex]
...@@ -285,10 +284,17 @@ public final class SsaDecoder extends SimpleSubtitleDecoder { ...@@ -285,10 +284,17 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
return timestampUs; 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 @Nullable
public static PointF parsePosition(String line){ private static PointF parsePosition(String line) {
Matcher matcher = SSA_POSITION_PATTERN.matcher(line); Matcher matcher = SSA_POSITION_PATTERN.matcher(line);
if(!matcher.find()){ if (!matcher.find()) {
return null; return null;
} }
float x = Float.parseFloat(matcher.group(1)); float x = Float.parseFloat(matcher.group(1));
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment