Fix typo in SubMaker's feed() logic (#331)

The start time should be the offset and the end time is
offset + duration.

Signed-off-by: rany <rany2@riseup.net>
This commit is contained in:
Rany
2024-11-23 13:30:16 +02:00
committed by GitHub
parent 144215496a
commit 17e5146606

View File

@@ -31,8 +31,8 @@ class SubMaker:
self.cues.append(
srt.Subtitle(
index=len(self.cues) + 1,
start=srt.timedelta(microseconds=msg["duration"] / 10),
end=srt.timedelta(microseconds=(msg["duration"] + msg["offset"]) / 10),
start=srt.timedelta(microseconds=msg["offset"] / 10),
end=srt.timedelta(microseconds=(msg["offset"] + msg["duration"]) / 10),
content=msg["text"],
)
)