summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorCarl Hetherington <cth@carlh.net>2020-04-01 13:24:01 +0000
committerCarl Hetherington <cth@carlh.net>2020-04-01 15:28:44 +0200
commitc46a8ccbb6fb8e70fd95a7fff57445968a03b9a8 (patch)
tree5413322d4c690f245ec888b316ac18fa6594d5eb /src
parent877f212035be55e8103a0dcaf572d93337122712 (diff)
Fix incorrect calculation of extension block number (EBN); previously
an incorrect 0 would be used if the line length was exactly 112.
Diffstat (limited to 'src')
-rw-r--r--src/stl_binary_writer.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/stl_binary_writer.cc b/src/stl_binary_writer.cc
index 456bbe1..adb9e11 100644
--- a/src/stl_binary_writer.cc
+++ b/src/stl_binary_writer.cc
@@ -272,7 +272,7 @@ make_tti_blocks (list<Subtitle> const& subtitles, STLBinaryTables const& tables,
offset += this_time;
/* Extension block number. Count up from 0 but use 0xff for the last one */
- put_int_as_int (buffer + 3, this_time < block_size ? 0xff : block_number, 1);
+ put_int_as_int (buffer + 3, offset == text.length() ? 0xff : block_number, 1);
++block_number;
char* finished = new char[tti_size];