Add comments about needing the size in the IDX file.

This commit is contained in:
Sven Wischnowsky 2024-12-18 21:15:31 +01:00 committed by Ian Baker
parent 27a6883768
commit 250bc86669

View File

@ -141,6 +141,10 @@ public final class VobsubParser implements SubtitleParser {
palette[i] = parseColor(values[i].trim()); palette[i] = parseColor(values[i].trim());
} }
} else if (line.startsWith("size: ")) { } else if (line.startsWith("size: ")) {
// NOTE: we need this line to calculate the relative positions
// and size required by Cue.Builder() below.
String[] sizes = line.substring(6).trim().split("x"); String[] sizes = line.substring(6).trim().split("x");
if (sizes.length == 2) { if (sizes.length == 2) {
@ -166,6 +170,9 @@ public final class VobsubParser implements SubtitleParser {
public void parseSpu(ParsableByteArray buffer) { public void parseSpu(ParsableByteArray buffer) {
// Give up if don't have the color palette or the video size.
// (See also the NOTE above)
if (palette == null || !hasPlane) return; if (palette == null || !hasPlane) return;
int pos = buffer.getPosition(); int pos = buffer.getPosition();