Remove hardcoded index when parsing PlayResX and PlayResY

This commit is contained in:
Arnold Szabo 2019-10-30 22:51:13 +02:00
parent 4d6d8060b4
commit 3b741e591f

View file

@ -101,10 +101,10 @@ public final class SsaDecoder extends SimpleSubtitleDecoder {
String currentLine;
while ((currentLine = data.readLine()) != null) {
if (currentLine.startsWith("PlayResX:")) {
playResX = Integer.valueOf(currentLine.substring(9).trim());
playResX = Integer.valueOf(currentLine.substring("PlayResX:".length()).trim());
}
if (currentLine.startsWith("PlayResY:")) {
playResY = Integer.valueOf(currentLine.substring(9).trim());
playResY = Integer.valueOf(currentLine.substring("PlayResY:".length()).trim());
}
// TODO: Parse useful data from the header.
if (currentLine.startsWith("[Events]")) {